/* ajwahirsama.com — shared design system
   Palette follows the printed card: gold ink on cream stock, inside the
   "Green Floral" emerald folder. */

:root {
  /* "emerald" names kept for the cascade; now warm mocha (text + deep accents) */
  --emerald-950: #4a3329;
  --emerald-900: #573d32;
  --emerald-800: #6a4b3e;
  --emerald-700: #7d5a4b;
  --emerald-600: #93705f;
  /* rose gold */
  --gold-50:  #fcf4ef;
  --gold-100: #f5e3d8;
  --gold-200: #ebcbb9;
  --gold-300: #dcb09a;
  --gold-400: #c8947c;
  --gold-500: #ae7a64;
  --gold-600: #8c5f4d;
  --cream:    #f4e7de;
  --cream-2:  #ecd8cc;
  --paper:    #f9f3ee;
  --blush:    #e8cbbd;
  --blush-2:  #dcb3a2;
  --ink:      #4a3329;
  --ink-soft: #8a6b5c;
  --rose:     #c99a8c;

  --f-display: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --f-caps:    "Cinzel", "Cormorant Garamond", Georgia, serif;
  --f-sans:    "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-arabic:  "Amiri", "Amiri Quran", "Scheherazade New", serif;
  --f-quran:   "Amiri Quran", "Amiri", serif;
  --f-script:  "Pinyon Script", "Cormorant Garamond", cursive;

  /* the body face changes per language — see [lang] rules below */
  --f-body: var(--f-display);
  --f-head: var(--f-display);
  --lh-body: 1.55;

  --gutter: clamp(16px, 5vw, 48px);
  --maxw: 1120px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --shimmer: linear-gradient(100deg,
      #9a6a55 0%, #c8947c 20%, #f2d9c9 32%, #c8947c 44%, #9a6a55 62%, #d6a990 80%, #9a6a55 100%);
}

/* Per-language faces. Latin names keep the display serif in every language. */
html[lang="ta"] { --f-body: "Noto Serif Tamil", "Hind Madurai", serif; --f-head: "Noto Serif Tamil", serif; --lh-body: 1.75; }
html[lang="ml"] { --f-body: "Noto Serif Malayalam", "Manjari", serif;  --f-head: "Noto Serif Malayalam", serif; --lh-body: 1.8; }
html[lang="ur"] { --f-body: "Noto Nastaliq Urdu", "Gulzar", serif;      --f-head: "Noto Nastaliq Urdu", serif; --lh-body: 2.3; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  line-height: var(--lh-body);
  font-size: clamp(17px, 1.05vw + 12px, 21px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100dvh;
}
body.locked { overflow: hidden; height: 100dvh; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 4px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- texture */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none;
  width: 200%; height: 200%;
  opacity: .05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); } 60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

.gold-text {
  background: var(--shimmer);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* SplitText children inherit the clip-text fill only if they repeat it */
.gold-text .ch, .gold-text .wd {
  background: inherit; background-size: inherit;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.caps {
  font-family: var(--f-caps); text-transform: uppercase;
  letter-spacing: .32em; font-weight: 500;
}
html[lang="ta"] .caps, html[lang="ml"] .caps, html[lang="ur"] .caps {
  font-family: var(--f-head); letter-spacing: .04em; text-transform: none; font-weight: 600;
}

/* --------------------------------------------------------------- ornament */
.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--gold-400); }
.ornament::before, .ornament::after {
  content: ""; height: 1px; width: clamp(48px, 12vw, 110px);
  background: linear-gradient(90deg, transparent, currentColor);
}
.ornament::after { transform: scaleX(-1); }
.ornament i {
  width: 8px; height: 8px; transform: rotate(45deg);
  border: 1px solid currentColor; display: block; flex: none;
}

/* -------------------------------------------------------------- buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 52px; padding: .75em 1.6em;
  border-radius: 999px; text-decoration: none;
  font-family: var(--f-body); font-size: .95em; font-weight: 600; letter-spacing: .02em;
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), background-color .4s, color .4s;
  isolation: isolate; overflow: hidden;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn--gold {
  color: #fffaf6;
  background: linear-gradient(135deg, #b98670, #9a6a55 55%, #ae7a64);
  box-shadow: 0 10px 30px -12px rgba(140, 95, 77, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn--gold::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .9s var(--ease-out);
}
.btn--gold:hover::after { transform: translateX(120%); }
.btn--line { color: inherit; border: 1px solid currentColor; background: transparent; }
.btn--line:hover { background: rgba(174, 122, 100, .1); }
.btn:active { transform: scale(.97); }
@media (hover: hover) { .btn:hover { transform: translateY(-2px); } }

/* ------------------------------------------------------ language picker */
.lang-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 2.4vw, 16px); width: min(440px, 100%);
}
.lang-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 84px; padding: 12px 10px;
  border-radius: 14px;
  color: var(--ink);
  background: linear-gradient(170deg, #fffaf6, #f6e9e0);
  border: 1px solid rgba(174, 122, 100, .45);
  box-shadow: 0 1px 0 #fff inset, 0 14px 28px -18px rgba(106, 75, 62, .55);
  transition: border-color .4s, transform .5s var(--ease-out), background .4s, box-shadow .4s;
  overflow: hidden;
}
.lang-btn::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--a, 0deg), transparent 0 70%, var(--gold-400) 85%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .4s;
  animation: spin-a 3.5s linear infinite;
}
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin-a { to { --a: 360deg; } }
.lang-btn:hover::before, .lang-btn:focus-visible::before, .lang-btn.is-current::before { opacity: 1; }
.lang-btn:hover, .lang-btn:focus-visible { border-color: var(--gold-500); background: linear-gradient(170deg, #fff, #f3dfd3); transform: translateY(-2px); box-shadow: 0 1px 0 #fff inset, 0 18px 30px -16px rgba(106, 75, 62, .6); }
.lang-btn .native { font-size: clamp(1.25rem, 4.6vw, 1.6rem); line-height: 1.25; font-weight: 500; }
.lang-btn .latin { font-family: var(--f-caps); font-size: .6rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-500); margin-top: 6px; }
.lang-btn[data-lang="en"] .native { font-family: var(--f-display); font-style: italic; }
.lang-btn[data-lang="ta"] .native { font-family: "Noto Serif Tamil", serif; font-size: clamp(1.1rem, 4vw, 1.35rem); }
.lang-btn[data-lang="ml"] .native { font-family: "Noto Serif Malayalam", serif; font-size: clamp(1.1rem, 4vw, 1.35rem); }
.lang-btn[data-lang="ur"] .native { font-family: "Noto Nastaliq Urdu", serif; font-size: clamp(1.1rem, 4vw, 1.35rem); line-height: 1.9; }

/* floating switcher, shown after a language is chosen */
.lang-switch {
  position: fixed; z-index: 80;
  top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right));
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px 0 12px; border-radius: 999px;
  font-family: var(--f-caps); font-size: .68rem; letter-spacing: .22em;
  color: var(--ink); box-shadow: 0 8px 24px -14px rgba(74, 51, 41, .5);
  background: rgba(249, 243, 238, .82);
  border: 1px solid rgba(217, 180, 106, .4);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transform: translateY(-10px);
  transition: opacity .6s, transform .6s var(--ease-out);
}
html[dir="rtl"] .lang-switch { right: auto; left: max(14px, env(safe-area-inset-left)); }
.lang-switch.show { opacity: 1; pointer-events: auto; transform: none; }
.lang-switch svg { width: 16px; height: 16px; }

.lang-sheet {
  position: fixed; inset: 0; z-index: 85;
  display: grid; place-items: center; padding: var(--gutter);
  background: rgba(74, 51, 41, .45);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden; transition: opacity .45s, visibility .45s;
}
.lang-sheet.open { opacity: 1; visibility: visible; }
.lang-sheet .inner { display: grid; justify-items: center; gap: 22px; width: 100%; }
.lang-sheet .title { color: var(--gold-50); font-family: var(--f-caps); letter-spacing: .3em; font-size: .75rem; }

/* ---------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .grain, .gold-text, .lang-btn::before { animation: none !important; }
  * { scroll-behavior: auto !important; }
}
