/* ==========================================================================
   chirayilgroup.com · v2 · Liquid Glass in the Chirayil palette
   --------------------------------------------------------------------------
   The material is the estate's shared Liquid Glass (kalikkalam/styles.css, as
   adapted for Kalavara): backdrop blur + saturation lift, the edge stack, a
   135deg specular sweep, an inner bloom. Decision (LD 2026-10-28): glass for
   the FRAME and short tiles; anything read at length sits on SOLID cards.
   Cormorant Garamond for the wordmark + headings (editorial), Rajdhani for UI.
   Dark only, like the rest of the brand's public pages.
   ========================================================================== */

:root {
  --bg: #080f18;  --card: #0e1d2e;  --card-2: #0b1929;
  --text: #e8f0ec;  --muted: rgba(232,240,236,.62);  --faint: rgba(232,240,236,.4);
  --hair: rgba(255,255,255,.08);
  --teal: #1d9e75;  --teal-l: #3dbf90;  --gold: #c8a96e;  --gold-l: #e0c080;
  --indigo: #6366f1;  --indigo-l: #a5b4fc;

  --lg-tint: rgba(255,255,255,.055);
  --lg-tint-raised: rgba(255,255,255,.09);
  --lg-blur: blur(24px) saturate(190%) brightness(1.12);
  --lg-blur-thin: blur(14px) saturate(160%) brightness(1.08);
  --lg-edge:
    inset 0  1px 0      rgba(255,255,255,.55),
    inset 0  0   0 1px  rgba(255,255,255,.16),
    inset 0 -1px 0      rgba(255,255,255,.07),
    inset 0  0  14px -8px  rgba(150,190,255,.40),
    inset 0  0  22px -14px rgba(255,220,190,.22);
  --lg-lift: 0 18px 50px -22px rgba(0,0,0,.75), 0 4px 14px -8px rgba(0,0,0,.55);

  --r-lg: 28px;  --r-md: 18px;  --r-sm: 12px;
  --spring: cubic-bezier(.34,1.36,.64,1);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Rajdhani', system-ui, -apple-system, sans-serif;
  --wrap: 1120px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-weight: 500; font-size: 17px; line-height: 1.55;
  min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal-l); outline-offset: 3px; border-radius: 6px; }

/* ── backdrop: fixed + vmax so the glass has something behind it at every scroll position ── */
.field { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .42; }
.blob-a { width: 64vmax; height: 64vmax; top: -26vmax; left: -18vmax; background: radial-gradient(circle at 40% 40%, var(--teal), transparent 68%); animation: drift-a 30s ease-in-out infinite alternate; }
.blob-b { width: 50vmax; height: 50vmax; top: -8vmax; right: -20vmax; background: radial-gradient(circle at 60% 60%, var(--gold), transparent 68%); opacity: .3; animation: drift-b 36s ease-in-out infinite alternate; }
.blob-c { width: 60vmax; height: 60vmax; bottom: -24vmax; left: -6vmax; background: radial-gradient(circle, #0f5a6e, transparent 68%); animation: drift-c 32s ease-in-out infinite alternate; }
.blob-d { width: 70vmax; height: 46vmax; top: 34%; left: 50%; margin-left: -35vmax; opacity: .26; background: radial-gradient(ellipse, var(--teal), transparent 66%); animation: drift-b 28s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate3d(60px, 40px, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(-50px, 60px, 0) scale(1.08); } }
@keyframes drift-c { to { transform: translate3d(70px, -40px, 0) scale(1.14); } }
.grain { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E"); }
.page { position: relative; z-index: 2; }

/* ── the material ── */
.glass { position: relative; isolation: isolate; background: var(--lg-tint);
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
  border-radius: var(--r-lg); box-shadow: var(--lg-edge), var(--lg-lift); }
.glass::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.3) 0%, rgba(255,255,255,.06) 26%, transparent 52%); }
.glass::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 22% -10%, rgba(255,255,255,.16) 0%, transparent 60%); }
.lift { transition: transform .32s var(--spring), background .18s ease, box-shadow .32s ease; }
@media (hover: hover) { .lift:hover { transform: translateY(-4px); background: var(--lg-tint-raised);
  box-shadow: var(--lg-edge), 0 26px 60px -24px rgba(0,0,0,.8), 0 6px 18px -8px rgba(0,0,0,.6); } }
.lift:active { transform: translateY(-1px) scale(.995); }
.solid { background: var(--card); border-radius: var(--r-md); box-shadow: 0 1px 0 var(--hair) inset, 0 14px 34px -26px rgba(0,0,0,.7); }

/* ── layout ── */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
section { padding: 56px 0; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--teal-l); margin-bottom: 12px; }
.h-serif { font-family: var(--serif); font-weight: 700; line-height: 1.05; letter-spacing: -.01em; }
.sec-title { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, 5vw, 52px); line-height: 1.05; margin-bottom: 12px; }
.sec-lead { color: var(--muted); font-size: 19px; max-width: 60ch; margin-bottom: 28px; }

/* ── header: a floating glass capsule ── */
.hdr { position: sticky; top: 12px; z-index: 30; margin: 12px auto 0; width: calc(100% - 24px); max-width: calc(var(--wrap) - 16px);
  height: 64px; border-radius: 22px; display: flex; align-items: center; gap: 12px; padding: 0 10px 0 20px; }
.logo { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: .03em; text-decoration: none; white-space: nowrap; }
.logo em { font-style: normal; color: var(--teal-l); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a, .nav button { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: none; border-radius: 999px;
  background: none; color: var(--muted); font: 700 14px var(--sans); letter-spacing: 1.2px; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: color .2s, background .2s; }
.nav a:hover, .nav button:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--lg-tint-raised); }
.nav .install { color: var(--teal-l); }
@media (max-width: 760px) { .nav .wide { display: none; } .hdr { padding-left: 16px; } .nav a, .nav button { padding: 0 10px; } }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; border: none;
  font: 700 16px var(--sans); letter-spacing: 1px; text-transform: uppercase; text-decoration: none; cursor: pointer;
  background: var(--lg-tint-raised); color: var(--text); -webkit-backdrop-filter: var(--lg-blur-thin); backdrop-filter: var(--lg-blur-thin);
  box-shadow: var(--lg-edge); transition: transform .18s var(--spring), box-shadow .2s, background .2s; }
.btn:active { transform: scale(.96); }
.btn-teal { background: linear-gradient(135deg, var(--teal), #27b384); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 12px 30px -12px rgba(29,158,117,.7); }
/* Kalikkalam keeps its own indigo: a link out to a separate property (v1.7.0 rule). */
.btn-play { background: linear-gradient(135deg, rgba(99,102,241,.32), rgba(67,56,202,.32)); color: #c7d2fe; box-shadow: inset 0 0 0 1px rgba(165,180,252,.35), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-ghost { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--muted); padding: 0 14px; }
.btn-ghost:hover { color: var(--text); }

/* ── hero ── */
.hero { padding: 88px 0 48px; }
.hero-title { font-family: var(--serif); font-weight: 700; font-size: clamp(50px, 9vw, 104px); line-height: .98; letter-spacing: -.015em; max-width: 12ch; }
.hero-title span { color: var(--teal-l); }
.hero-sub { font-size: clamp(19px, 2.2vw, 23px); color: var(--muted); max-width: 46ch; margin: 22px 0 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 700;
  color: var(--muted); background: var(--lg-tint); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 0 0 1px rgba(255,255,255,.1);
  -webkit-backdrop-filter: var(--lg-blur-thin); backdrop-filter: var(--lg-blur-thin); }
.pill b { color: var(--teal-l); }

/* ── tool tiles (short text: glass, lifts on hover) ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 22px; text-decoration: none; color: var(--text); min-height: 220px; }
.tile-top { display: flex; align-items: center; gap: 14px; }
.tile-icon { width: 52px; height: 52px; border-radius: 15px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); overflow: hidden; }
.tile-icon img { width: 100%; height: 100%; object-fit: cover; }
.tile-name { font-family: var(--serif); font-size: 28px; font-weight: 700; line-height: 1; }
.tile-tag { font-size: 15px; color: var(--gold-l); font-weight: 700; }
.tile-desc { color: var(--muted); font-size: 16px; flex: 1; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--teal-l); }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: rgba(200,169,110,.16); color: var(--gold-l); }
.badge.beta { background: rgba(61,191,144,.14); color: var(--teal-l); }

/* ── Kalikkalam strip (its own indigo identity) ── */
.games { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 28px 30px; text-decoration: none; color: var(--text);
  background: linear-gradient(135deg, rgba(99,102,241,.16), rgba(168,85,247,.10)); }
.games-mark { width: 84px; height: 84px; }
.games h3 { font-family: var(--serif); font-size: 40px; line-height: 1; }
.games p { color: var(--muted); margin-top: 6px; max-width: 52ch; }
@media (max-width: 700px) { .games { grid-template-columns: 1fr; text-align: left; } .games-mark { width: 64px; height: 64px; } }

/* ── how-we-build teaser + author tile ── */
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.teaser { padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.teaser h3, .author h3 { font-family: var(--serif); font-size: 36px; line-height: 1.05; }
.checks { list-style: none; display: grid; gap: 10px; margin: 6px 0 8px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.checks li::before { content: '✓'; flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--teal-l); background: rgba(29,158,117,.16); }
.author { padding: 30px; display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: var(--text); }
.avatar { width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 40px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, var(--teal), #0f5a6e); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 10px 30px -12px rgba(29,158,117,.7); }
.author p { color: var(--muted); }

/* ── blog cards (read: solid) ── */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.post { padding: 22px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--text); transition: transform .32s var(--spring); }
@media (hover: hover) { .post:hover { transform: translateY(-3px); } }
.post-meta { font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold-l); }
.post h3 { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.post p { color: var(--muted); font-size: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── footer ── */
.foot { padding: 34px 0 calc(env(safe-area-inset-bottom, 0px) + 34px); border-top: 1px solid var(--hair); margin-top: 24px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600; }
.foot a:hover { color: var(--teal-l); }
.foot small { color: var(--faint); font-size: 14px; }

/* ── iPhone install sheet (feedback_pwa_install_ios) ── */
.ios-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(4,8,14,.5); display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s; }
.ios-scrim.open { opacity: 1; pointer-events: auto; }
.ios-sheet { width: min(480px, 100%); padding: 14px 26px calc(env(safe-area-inset-bottom, 0px) + 26px); border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: rgba(14,29,46,.94); transform: translateY(100%); transition: transform .4s var(--spring); }
.ios-scrim.open .ios-sheet { transform: none; }
.ios-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--hair); margin: 0 auto 18px; }
.ios-sheet h2 { font-family: var(--serif); font-size: 30px; margin-bottom: 14px; }
.ios-sheet ol { list-style: none; display: grid; gap: 14px; counter-reset: s; }
.ios-sheet li { display: flex; gap: 14px; align-items: center; counter-increment: s; }
.ios-sheet li::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--teal-l); background: rgba(29,158,117,.16); }

/* ── motion + fallbacks ── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .9s var(--spring); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .blob, .float-icon { animation: none !important; } .reveal { opacity: 1; transform: none; }
  /* Shorten AND stop looping: a .01ms animation left on `infinite` replays ~100,000 times a second,
     and each frame lands on a random point of it, so the hero icons shook instead of resting (v2.0.1). */
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .btn, .pill { background: var(--card) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .field, .grain { display: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass, .btn, .pill { background: var(--card); } }

/* ── desktop hero art: the tools as floating glass icons (v2.0.0) ── */
.hero-art { display: none; }
@media (min-width: 960px) {
  .hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: 40px; }
  .hero-art { display: grid; grid-template-columns: repeat(3, 112px); gap: 22px; justify-content: center; padding: 20px 0; }
  .float-icon { width: 112px; height: 112px; border-radius: 30px; display: flex; align-items: center; justify-content: center;
    animation: float 6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.9s); }
  .float-icon:nth-child(3n+2) { transform: translateY(34px); }
  .float-icon:nth-child(7) { grid-column: 2; transform: translateY(34px); }   /* follows its column's offset */
  .float-icon span { width: 64px; height: 64px; border-radius: 18px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 40px; }
  .float-icon span img, .float-icon span svg { width: 100%; height: 100%; object-fit: cover; }
}
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
.tile-foot .badges { display: flex; flex-wrap: wrap; gap: 6px; }
