/* ============================================================================
   WithRajesh.com - UI Redesign v2 (Feature #22) - Base styles + utilities
   Fonts: Inter (body, self-hosted) + Fraunces (serif display, CDN in static;
   self-host in the SSR port). Plus craft utilities: grain, gold rule, lift.
   ============================================================================ */

/* Inter variable (self-hosted) */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/InterVariable-Italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* Lora variable (serif headings, self-hosted - latin + latin-ext, 400..700) */
@font-face {
  font-family: 'Lora';
  src: url('../fonts/Lora-Normal-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/Lora-Normal-latinext.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/Lora-Italic-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/Lora-Italic-latinext.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Alpine: hide x-cloak until init */
[x-cloak] { display: none !important; }

/* Smooth, accessible transitions */
a, button, [role="button"], input, select, textarea {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, opacity .2s ease, transform .2s ease;
}
html { scroll-behavior: smooth; overflow-x: clip; }
body { overflow-x: clip; }

/* Grid/flex children shrink below content min-width (prevents narrow-screen overflow) */
.pillar-rows > .grid > * { min-width: 0; }

/* Visible, on-brand keyboard focus ring (keyboard users only) */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Selection in brand gold */
::selection { background: var(--gold-100); color: var(--color-text-primary); }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--color-surface); color: var(--color-text-primary);
  padding: .5rem 1rem; border-radius: var(--radius); border: 1px solid var(--color-border);
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ----------------------------------------------------------------------------
   Craft utilities
   ---------------------------------------------------------------------------- */

/* Grain/noise overlay - layered on heroes/feature panels for texture */
.grain::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  opacity: var(--grain-opacity);
  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='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Eyebrow / kicker - uppercase gold micro-label (rajesh.in) */
.eyebrow {
  display: inline-flex; align-items: center; gap: .75rem;
  font-size: 11px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  color: var(--color-brand);
}

/* Cinzel logo wordmark (rajesh.in .logo) */
.logo { font-family: var(--font-logo, 'Cinzel'), ui-serif, serif; letter-spacing: .14em; }

/* Ultra-wide micro-label tracking */
.tracking-luxe { letter-spacing: .42em; }

/* Hover lift for interactive cards */
.lift { transition: transform .5s ease, box-shadow .5s ease, border-color .5s ease; }
.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }

/* Hide scrollbar (horizontal filter rails) while keeping scroll */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Gold accent text (solid brand color) */
.text-gold {
  color: var(--color-brand);
}

/* Gold gradient text - rajesh.in signature (.gold-grad) for hero sub-line + stats */
.gold-grad {
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold) 45%, var(--gold-deep) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* Radial gold glow for hero backgrounds */
.glow-gold {
  background: radial-gradient(60% 50% at 50% 0%, rgba(var(--gold-rgb2),0.16), transparent 70%);
}
.dark .glow-gold {
  background: radial-gradient(60% 55% at 50% 0%, rgba(var(--gold-rgb2),0.12), transparent 70%);
}

/* Ambient gold background - three soft radial glows over ink (rajesh.in .ambient) */
.ambient {
  background-color: var(--color-bg-primary);
  background-image:
    radial-gradient(70% 55% at 50% -5%, rgba(var(--gold-rgb2),0.16), transparent 68%),
    radial-gradient(45% 45% at 88% 12%, rgba(var(--gold-rgb2),0.08), transparent 70%),
    radial-gradient(50% 50% at 10% 60%, rgba(var(--gold-rgb2),0.05), transparent 72%);
  background-attachment: fixed;
}

/* ----------------------------------------------------------------------------
   Form fields (auth + contact) - rajesh.in .field / .field-label
   ---------------------------------------------------------------------------- */
.field-label {
  display: block; margin-bottom: .5rem;
  font-size: 13px; font-weight: 500; color: var(--color-text-secondary);
}
.field {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .7rem .9rem;
  font-size: .9375rem; color: var(--color-text-primary);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.field::placeholder { color: var(--color-text-muted); }
.field:focus {
  outline: none; border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb),0.14);
}
textarea.field { resize: vertical; min-height: 6rem; }

/* OTP / code input - wide tracking monospace */
.field-otp {
  text-align: center; letter-spacing: .5em; font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.25rem;
}

/* Card (rajesh.in .card) - faint surface gradient + gold hairline that warms on hover */
.card {
  background: linear-gradient(180deg, rgba(var(--gold-rgb),0.025), rgba(var(--gold-rgb),0.01));
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  transition: border-color .5s ease, box-shadow .5s ease, transform .5s ease;
}
.card:hover { border-color: var(--color-border-hover); box-shadow: var(--shadow-sm); }

/* Primary pill button (rajesh.in .cta) */
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 2rem; border-radius: 9999px;
  font-size: .875rem; font-weight: 500; letter-spacing: .01em;
  color: var(--color-text-on-brand);
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  border: 1px solid var(--gold-soft);
  transition: filter .25s ease, box-shadow .25s ease;
}
.cta:hover {
  filter: brightness(1.07);
  box-shadow: 0 0 0 1px rgba(var(--gold-rgb2),0.25), 0 8px 24px -8px rgba(var(--gold-rgb2),0.5);
}

/* Secondary / ghost pill button (rajesh.in .ghost) */
.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 2rem; border-radius: 9999px;
  font-size: .875rem; font-weight: 500;
  color: var(--gold-deep);
  background: linear-gradient(180deg, rgba(var(--gold-rgb2),0.06), rgba(var(--gold-rgb2),0.02));
  border: 1px solid rgba(var(--gold-rgb2),0.32);
  transition: color .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
}
.ghost:hover {
  color: var(--color-text-primary); border-color: var(--color-brand);
  background: linear-gradient(180deg, rgba(var(--gold-rgb2),0.12), rgba(var(--gold-rgb2),0.05));
  box-shadow: 0 0 0 1px rgba(var(--gold-rgb2),0.18), 0 8px 24px -10px rgba(var(--gold-rgb2),0.45);
}
.dark .ghost { color: var(--gold-soft); }

/* ----------------------------------------------------------------------------
   AI hero background: drifting gold orbs (soft glow).
   Pure CSS, GPU-accelerated (transform/opacity only), reduced-motion safe.
   ---------------------------------------------------------------------------- */
.ai-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }

/* soft floating gold orbs */
.ai-orb {
  position: absolute; border-radius: 9999px; filter: blur(60px);
  opacity: 0.5; will-change: transform;
}
.dark .ai-orb { opacity: 0.4; }
.ai-orb-1 { width: 460px; height: 460px; top: -120px; left: -80px;
  background: radial-gradient(circle, rgba(var(--gold-rgb2),0.50), transparent 70%);
  animation: orbDrift1 22s ease-in-out infinite; }
.ai-orb-2 { width: 380px; height: 380px; top: -60px; right: -60px;
  background: radial-gradient(circle, rgba(var(--gold-rgb),0.42), transparent 70%);
  animation: orbDrift2 26s ease-in-out infinite; }
.ai-orb-3 { width: 320px; height: 320px; top: 180px; left: 45%;
  background: radial-gradient(circle, rgba(var(--gold-rgb),0.26), transparent 70%);
  animation: orbDrift3 30s ease-in-out infinite; }

@keyframes orbDrift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,40px) scale(1.12); } }
@keyframes orbDrift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,30px) scale(1.08); } }
@keyframes orbDrift3 { 0%,100% { transform: translate(-50%,0) scale(1); } 50% { transform: translate(calc(-50% + 40px),-30px) scale(1.1); } }

@media (prefers-reduced-motion: reduce) {
  .ai-orb { animation: none !important; }
}


/* Blueprint grid - faint engineering grid that fades out toward edges */
.blueprint {
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 0%, #000 35%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 60% at 50% 0%, #000 35%, transparent 78%);
  opacity: 0.6;
}
.dark .blueprint { opacity: 0.35; }

/* Pillar feature rows - each row is a contained panel with a faint section tint
   so the 9 rows read as distinct "one after one" cards, not one long list. */
.pillar-rows > .grid {
  position: relative;
  isolation: isolate;
  border-radius: 1.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  padding: 1.75rem;
}
.pillar-rows > .grid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  /* section-hued wash, strongest behind the mockup corner, fading across */
  background: radial-gradient(120% 90% at 100% 0%, var(--bg), transparent 55%);
  opacity: 0.7;
}
.dark .pillar-rows > .grid { background: var(--color-surface); }
@media (min-width: 768px) {
  .pillar-rows > .grid { border-radius: 2rem; padding: 2.5rem 3rem; }
}

/* Soften the pillar mockup preview shadow (lighter than --shadow-lg) */
.pillar-rows .grid .rounded-2xl.overflow-hidden { box-shadow: var(--shadow-sm); }



/* Hairline divider - center-fading gold line (rajesh.in .rule) */
.rule { height: 1px; border: 0;
  background: linear-gradient(90deg, transparent, rgba(var(--gold-rgb),0.5), transparent); }

/* ----------------------------------------------------------------------------
   Article prose - long-form reading rhythm for the article detail page
   ---------------------------------------------------------------------------- */
.article-prose { font-size: 1.125rem; line-height: 1.8; color: var(--color-text-secondary); }
.article-prose > * + * { margin-top: 1.5rem; }
.article-prose p { color: var(--color-text-secondary); }
.article-prose h2 {
  font-family: var(--font-heading), serif; font-weight: 700;
  font-size: 1.6rem; line-height: 1.25; color: var(--color-text-primary);
  margin-top: 2.75rem; letter-spacing: -0.01em;
}
.article-prose h3 {
  font-family: var(--font-heading), serif; font-weight: 600;
  font-size: 1.3rem; color: var(--color-text-primary); margin-top: 2.25rem;
}
.article-prose a { color: var(--color-brand); text-decoration: underline; text-underline-offset: 2px; }
.article-prose strong { color: var(--color-text-primary); font-weight: 600; }
.article-prose blockquote {
  margin: 2.25rem 0; padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--color-brand);
  font-family: var(--font-heading), serif; font-style: italic;
  font-size: 1.35rem; line-height: 1.5; color: var(--color-text-primary);
}
.article-prose ul, .article-prose ol { padding-left: 1.5rem; }
.article-prose li { margin-top: 0.5rem; }
.article-prose ul li { list-style: disc; }
.article-prose ol li { list-style: decimal; }
.article-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em;
  background: var(--color-bg-tertiary); padding: 0.15em 0.4em; border-radius: 0.35rem;
}

/* ----------------------------------------------------------------------------
   Scroll reveal (respects reduced motion)
   ---------------------------------------------------------------------------- */
[data-animate] { opacity: 0; transform: translateY(18px); }
[data-animate].in { animation: fadeUp .6s cubic-bezier(.22,.61,.36,1) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
[data-animate-delay="1"] { animation-delay: .08s; }
[data-animate-delay="2"] { animation-delay: .16s; }
[data-animate-delay="3"] { animation-delay: .24s; }
[data-animate-delay="4"] { animation-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  [data-animate] { opacity: 1 !important; transform: none !important; }
}

/* Scroll progress bar */
.scroll-progress { transform-origin: left; transform: scaleX(0); }
