@font-face {
  font-family: "Figtree";
  src: url("/assets/Figtree-Regular.ttf") format("truetype");
  font-display: swap;
  font-weight: 400 600;
}
@font-face {
  font-family: "Figtree";
  src: url("/assets/Figtree-Bold.ttf") format("truetype");
  font-display: swap;
  font-weight: 700 900;
}

:root {
  --gold: #c78a12;
  --gold-dark: #7a4b00;
  --gold-light: #e3aa28;
  --cream: #fff8df;
  --ink: #211a0d;
  --dark: #17130b;
  --muted: #75684c;
  --line: #e7d398;
  --paper: #fffdf7;
  --panel: #fffaf0;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Figtree", ui-sans-serif, system-ui, sans-serif; }
button, input, textarea { font: inherit; }
button, .upload { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.site-header {
  min-height: 88px;
  padding: 10px max(24px, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 247, .96);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: auto; height: 64px; object-fit: contain; }
.brand-copy { display: none; line-height: 1.1; }
.brand-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.site-nav { display: flex; align-items: center; gap: 5px; }
.site-nav a { padding: 10px 14px; border-radius: 5px; color: var(--muted); text-decoration: none; font-size: 14px; }
.site-nav a:hover, .site-nav a.active { background: #fff1bd; color: var(--gold-dark); font-weight: 700; }

.intro { min-height: 490px; display: grid; align-items: center; overflow: hidden; background: #080705; color: #fff; }
.intro-inner { width: min(1120px, calc(100% - 48px)); margin: 0 auto; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 64px; }
.intro-copy { position: relative; z-index: 2; padding: 72px 0; }
.eyebrow, .step { margin: 0; color: var(--gold-light); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.intro h1 { margin: 16px 0 20px; max-width: 720px; font-size: clamp(44px, 6.2vw, 78px); line-height: .98; letter-spacing: -.045em; }
.intro h1 span { color: #f0b528; }
.intro-copy > p:not(.eyebrow) { max-width: 650px; margin: 0; color: #d9d2c2; font-size: 17px; line-height: 1.65; }
.intro-tags { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.intro-tags span { padding: 8px 11px; border: 1px solid rgba(240, 181, 40, .38); border-radius: 5px; color: #f4d887; font-size: 11px; }
.intro-logo { width: min(100%, 520px); opacity: .58; filter: saturate(.92); }

.content-shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 76px 0 64px; }
.section-heading { max-width: 720px; margin-bottom: 30px; }
.section-heading h2 { margin: 10px 0 10px; font-size: clamp(28px, 4vw, 42px); line-height: 1.1; letter-spacing: -.025em; }
.section-heading > p:last-child { margin: 0; color: var(--muted); line-height: 1.6; }

.workspace { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.font-panel { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.2fr); gap: 28px 42px; align-items: center; padding: 28px; border-bottom: 1px solid var(--line); }
h3 { margin: 6px 0 0; font-size: 22px; }
.muted { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.upload { min-height: 92px; padding: 16px; display: flex; align-items: center; justify-content: center; gap: 13px; border: 1px dashed #caa758; border-radius: 8px; background: var(--cream); cursor: pointer; transition: background .16s, border-color .16s; }
.upload:hover, .upload.dragging { background: #ffefb9; border-color: var(--gold-dark); }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-icon { width: 38px; height: 38px; border: 1px solid #c58b12; border-radius: 6px; display: grid; place-items: center; color: var(--gold-dark); font-size: 22px; }
.upload > span:last-child { display: grid; }
.upload small { color: var(--muted); margin-top: 4px; }
.font-status { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #aaa297; }
.font-status.ready .status-dot, .output-meta .status-dot { background: #2f9760; box-shadow: 0 0 0 4px rgba(47, 151, 96, .12); }
.font-status.error .status-dot { background: #b63627; }

.controls { padding: 16px 28px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
.range-control { flex: 1; min-width: 240px; }
.range-control > span { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.range-control output { color: var(--gold-dark); }
.range-control input { width: 100%; accent-color: var(--gold-dark); }
.check-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.check-control input { width: 17px; height: 17px; accent-color: var(--gold-dark); }

.text-grid { display: grid; grid-template-columns: 1fr 1fr; }
.text-card { min-width: 0; padding: 28px; }
.text-card + .text-card { border-left: 1px solid var(--line); }
.card-head { min-height: 54px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.text-button, .copy-button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 750; }
.text-button:hover, .copy-button:hover { border-color: var(--gold); color: var(--gold-dark); }
.copy-button { background: var(--gold); border-color: var(--gold); color: #fff; }
.copy-button:hover { background: var(--gold-dark); color: #fff; }
#arabic-input, .arabic-output { width: 100%; min-height: 290px; margin-top: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: #14120f; font-family: "UploadedQuranFont", "Traditional Arabic", "Noto Naskh Arabic", serif; font-size: 48px; line-height: 1.9; text-align: right; overflow-wrap: anywhere; }
#arabic-input { resize: vertical; outline: none; }
#arabic-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(199, 138, 18, .12); }
.arabic-output { white-space: pre-wrap; }
.count { margin: 10px 0 0; color: var(--muted); font-size: 11px; text-align: right; }
.output-meta { margin-top: 10px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.output-meta span:first-child { display: flex; align-items: center; gap: 8px; }
.privacy-note { margin-top: 18px; padding: 18px 20px; display: grid; grid-template-columns: 160px 1fr; gap: 20px; border-left: 3px solid var(--gold); background: var(--cream); }
.privacy-note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

footer { background: #100d08; color: #f4ead2; }
.footer-inner { width: min(1120px, calc(100% - 48px)); min-height: 170px; margin: 0 auto; padding: 34px 0; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 80px; }
.footer-brand img { width: auto; height: 72px; object-fit: contain; }
.footer-inner > div { display: grid; gap: 7px; min-width: 125px; }
.footer-inner strong { color: #fff; }
.footer-inner a, .footer-inner span { color: #cbbd9c; text-decoration: none; font-size: 13px; }
.footer-inner a:hover { color: #f0b528; }

@media (max-width: 760px) {
  .site-header { min-height: 76px; }
  .brand img { height: 54px; }
  .site-nav a:first-child { display: none; }
  .intro { min-height: auto; }
  .intro-inner { grid-template-columns: 1fr; }
  .intro-copy { padding: 64px 0 70px; }
  .intro-logo { display: none; }
  .font-panel, .text-grid { grid-template-columns: 1fr; }
  .font-panel { gap: 22px; }
  .text-card + .text-card { border-left: 0; border-top: 1px solid var(--line); }
  .controls { align-items: stretch; flex-wrap: wrap; }
  .range-control { flex-basis: 100%; }
  .privacy-note { grid-template-columns: 1fr; gap: 6px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .site-header { padding-inline: 16px; }
  .brand img { height: 48px; max-width: 180px; }
  .site-nav a { padding: 9px 10px; }
  .intro-inner, .content-shell, .footer-inner { width: min(100% - 28px, 1120px); }
  .intro h1 { font-size: 41px; }
  .content-shell { padding-top: 56px; }
  .font-panel, .controls, .text-card { padding: 20px; }
  #arabic-input, .arabic-output { min-height: 230px; padding: 16px; }
  .card-head { align-items: center; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-brand { grid-column: auto; }
}
