/* ==========================================================
   Anjneya Tech
   Design rules
   - One accent (brand blue), cool neutral greys, page follows system theme.
   - Shape: containers and tiles 20px, media 12-16px, buttons full pill, app icons 22%.
   - Motion: transform/opacity only, disabled under prefers-reduced-motion.
   ========================================================== */

@font-face {
  font-family: "Geist";
  src: url("assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --tint: #eef1f5;
  --ink: #11151c;
  --ink-2: #485161;
  --ink-3: #636c7a;
  --line: #e1e5eb;
  --accent: #1f5fd6;
  --accent-hover: #1a52ba;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(17, 32, 64, .05), 0 12px 32px -16px rgba(17, 32, 64, .18);
  --shadow-lift: 0 2px 4px rgba(17, 32, 64, .06), 0 24px 48px -20px rgba(17, 32, 64, .28);
  --r-lg: 20px;
  --r-md: 14px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --wrap: 1180px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0f14;
    --surface: #141922;
    --tint: #10141b;
    --ink: #eef1f6;
    --ink-2: #b4bcc8;
    --ink-3: #8c95a3;
    --line: #232a35;
    --accent: #6f9ff6;
    --accent-hover: #8ab1f8;
    --accent-ink: #0c0f14;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -16px rgba(0, 0, 0, .6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 24px 48px -20px rgba(0, 0, 0, .7);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.03rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 4.6vw, 3.6rem); font-weight: 640; line-height: 1.06; letter-spacing: -0.038em; }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 620; line-height: 1.12; letter-spacing: -0.03em; }
h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.012em; line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.ic { width: 1.1em; height: 1.1em; flex: none; fill: currentColor; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px;
  background: var(--surface); color: var(--ink); border-radius: var(--r-md); box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 560; font-size: .97rem; white-space: nowrap; cursor: pointer;
  transition: background-color .2s, transform .2s var(--ease), border-color .2s;
}
.btn:active { transform: scale(.98); }
.btn-solid { background: var(--accent); color: var(--accent-ink); }
.btn-solid:hover { background: var(--accent-hover); }
.btn-outline { color: var(--ink); border-color: var(--line); background: var(--surface); }
.btn-outline:hover { border-color: var(--ink-3); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: .9rem; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 560; }
.link-arrow .ic { transition: transform .25s var(--ease); }
.link-arrow:hover .ic { transform: translate(2px, -2px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 620; letter-spacing: -.015em; font-size: 1.05rem; }
.brand img { border-radius: 8px; }
.site-nav { display: flex; align-items: center; gap: 30px; }
.site-nav a:not(.btn) { color: var(--ink-2); font-size: .95rem; font-weight: 500; transition: color .2s; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="true"] { color: var(--ink); }
.menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(48px, 7vw, 88px) clamp(56px, 8vw, 104px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.eyebrow { color: var(--accent); font-weight: 560; font-size: .95rem; margin-bottom: 18px; }
.hero-sub { margin-top: 22px; font-size: clamp(1.05rem, 1.4vw, 1.18rem); color: var(--ink-2); max-width: 32em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 34px; }

.hero-media { position: relative; aspect-ratio: 6 / 5; }
.hero-media img { position: absolute; border-radius: var(--r-md); box-shadow: var(--shadow-lift); background: var(--tint); }
.hm-main { top: 4%; left: 0; width: 86%; z-index: 1; }
.hm-side { top: 22%; right: 0; width: 28%; z-index: 2; }
.hm-low { bottom: 2%; left: 6%; width: 52%; z-index: 3; }

/* ---------- Facts ---------- */
.facts-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-block: 0; }
.facts div { display: flex; flex-direction: column; gap: 4px; padding: 28px 24px 28px 0; }
.facts dd { order: -1; }
.facts div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.facts dd { margin: 0; font-size: clamp(1.7rem, 2.6vw, 2.2rem); font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.facts dt { color: var(--ink-3); font-size: .92rem; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(72px, 9vw, 120px); }
.section-tint { background: var(--tint); }
.section-head { max-width: 40rem; margin-bottom: 44px; }
.section-head p { margin-top: 14px; color: var(--ink-2); font-size: 1.08rem; }

/* ---------- Tools bento ---------- */
.bento {
  display: grid; gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "openany openany clean"
    "qrino   onecalc clean"
    "chess   chess   adlens";
}
.t-openany { grid-area: openany; } .t-clean { grid-area: clean; } .t-qrino { grid-area: qrino; }
.t-onecalc { grid-area: onecalc; } .t-chess { grid-area: chess; } .t-adlens { grid-area: adlens; }

.tile {
  display: flex; flex-direction: column; overflow: hidden; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: transparent; }
.tile:active { transform: translateY(-2px) scale(.995); }
.tile-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--tint); transition: transform .8s var(--ease); }
.tile:hover .tile-img { transform: scale(1.025); }
.t-clean .tile-img, .t-adlens .tile-img { flex: 1 1 0; min-height: 220px; aspect-ratio: auto; object-position: top center; }
.tile-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 24px; position: relative; background: var(--surface); }
.tile-id { display: flex; align-items: center; gap: 12px; margin-bottom: 2px; }
.tile-id img { width: 44px; height: 44px; border-radius: 22%; }
.tile-id p { color: var(--ink-3); font-size: .9rem; }
.tile-desc { color: var(--ink-2); font-size: .97rem; max-width: 46ch; }
.tile-meta { color: var(--ink-3); font-size: .87rem; }
.tile-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--accent); font-weight: 560; font-size: .93rem; }
.tile-cta .ic { transition: transform .3s var(--ease); }
.tile:hover .tile-cta .ic { transform: translate(2px, -2px); }

/* ---------- Games ---------- */
.posters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.poster { display: block; color: inherit; }
.poster img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top center;
  border-radius: var(--r-lg); box-shadow: var(--shadow); background: var(--surface);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.posters li:first-child .poster img { object-position: left center; }
.poster:hover img { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.poster h3 { margin-top: 18px; }
.poster p { margin-top: 6px; color: var(--ink-2); font-size: .95rem; }

/* ---------- Principles ---------- */
.principles-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 48px; }
.principles li { border-top: 1px solid var(--line); padding-top: 22px; }
.principles .ic { width: 26px; height: 26px; color: var(--accent); margin-bottom: 16px; }
.principles p { margin-top: 8px; color: var(--ink-2); font-size: .97rem; }

/* ---------- Closing / contact ---------- */
.closing { border-top: 1px solid var(--line); }
.closing-inner { max-width: 38rem; text-align: center; display: flex; flex-direction: column; align-items: center; }
.closing-inner img { border-radius: 14px; margin-bottom: 26px; }
.closing-inner p { margin: 16px 0 30px; color: var(--ink-2); font-size: 1.08rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 28px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; color: var(--ink-3); font-size: .9rem; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-row a { color: var(--ink-2); }
.footer-row a:hover { color: var(--ink); }
.fine { width: 100%; font-size: .8rem; }

/* ---------- Document pages (privacy, deletion, 404) ---------- */
.doc { max-width: 760px; padding-block: clamp(40px, 7vw, 80px); }
.doc .back { display: inline-flex; gap: 6px; font-weight: 560; margin-bottom: 28px; }
.doc h1 { font-size: clamp(2rem, 4.2vw, 2.7rem); margin-bottom: 10px; }
.doc h2 { font-size: 1.3rem; margin: 2.2em 0 .6em; }
.doc p, .doc li { color: var(--ink-2); }
.doc p { margin-bottom: 1em; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 1em; }
.doc ul { list-style: disc; }
.doc li { margin-bottom: .45em; }
.doc strong { color: var(--ink); font-weight: 600; }
.updated { color: var(--ink-3); font-size: .92rem; }
.pill { display: inline-block; font-size: .85rem; color: var(--ink-2); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; margin-bottom: 1.5em; }
.callout { background: var(--tint); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; margin: 1.5em 0; }
.callout p { margin: 0; color: var(--ink); }
.notfound { text-align: center; min-height: 70vh; display: grid; place-content: center; justify-items: center; }
.notfound img { border-radius: 14px; margin-bottom: 24px; }
.notfound p { margin-top: 12px; }

/* ---------- Legal pages ---------- */
.legal { padding-block: clamp(32px, 6vw, 64px) clamp(72px, 9vw, 112px); }
.legal .back { display: inline-flex; gap: 6px; font-weight: 560; margin-bottom: 28px; }
.legal-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.legal-head h1 { font-size: clamp(2.2rem, 4.4vw, 3rem); }
.legal-head .updated { margin-top: 10px; }
.legal-head .callout { margin: 28px 0 0; }
.legal-grid { display: grid; grid-template-columns: 220px minmax(0, 68ch); gap: clamp(40px, 6vw, 80px); align-items: start; }
.toc { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow-y: auto; font-size: .9rem; }
.toc summary { list-style: none; font-weight: 600; color: var(--ink); margin-bottom: 12px; cursor: pointer; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--ink-3); line-height: 1.4; transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--accent); border-left-color: var(--accent); }
.legal-body section { scroll-margin-top: 92px; }
.legal-body section + section { margin-top: 52px; }
.legal-body h2 { font-size: 1.35rem; letter-spacing: -.02em; margin-bottom: 14px; }
.legal-body h3 { font-size: 1.02rem; margin: 26px 0 8px; }
.legal-body p, .legal-body li { color: var(--ink-2); }
.legal-body p + p { margin-top: 14px; }
.legal-body ul, .legal-body ol { padding-left: 1.25em; margin: 12px 0; }
.legal-body ul { list-style: disc; }
.legal-body ol { list-style: decimal; }
.legal-body li { margin-bottom: 8px; padding-left: 4px; }
.legal-body li::marker { color: var(--ink-3); }
.legal-body strong { color: var(--ink); font-weight: 600; }
.legal-body .btn { margin-top: 4px; }
.legal-single { max-width: 68ch; }
.notice-list p + p { margin-top: 18px; }
.callout-strong { background: var(--surface); border-left: 3px solid var(--accent); }
.callout-strong p + p { margin-top: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); margin: 18px 0; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table-wrap th, .table-wrap td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.table-wrap thead th { background: var(--tint); color: var(--ink); font-weight: 600; font-size: .85rem; }
.table-wrap tbody th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.table-wrap tbody tr:last-child > * { border-bottom: 0; }

@media (max-width: 900px) {
  .legal-grid { grid-template-columns: 1fr; gap: 32px; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
  .toc summary { margin: 0; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; }
  .toc summary::after { content: "+"; font-weight: 400; font-size: 1.2rem; color: var(--ink-3); }
  .toc details[open] summary::after { content: "\2212"; }
  .toc ol { margin: 0 18px 16px; }
}

/* ---------- Entrance motion (JS adds .js; content stays visible without it) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
  .js .reveal.in { opacity: 1; transform: none; }
  .hero-copy > *, .hero-media img { animation: rise .9s var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: .06s; }
  .hero-copy > :nth-child(3) { animation-delay: .12s; }
  .hero-copy > :nth-child(4) { animation-delay: .18s; }
  .hm-main { animation-delay: .1s; } .hm-side { animation-delay: .22s; } .hm-low { animation-delay: .32s; }
  @keyframes rise { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "openany openany" "clean qrino" "clean onecalc" "chess chess" "adlens adlens"; }
  .t-adlens .tile-img { flex: none; aspect-ratio: 16 / 9; }
  .posters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .menu-btn {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 44px; height: 44px; padding: 0 11px; margin-right: -11px; background: none; border: 0; cursor: pointer;
  }
  .menu-btn span { height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease); }
  .menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .site-nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 24px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.02rem; }
  .site-nav .btn { margin-top: 18px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { max-width: 560px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts div:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .bento { grid-template-columns: 1fr; grid-template-areas: "openany" "clean" "qrino" "onecalc" "chess" "adlens"; gap: 16px; }
  .t-clean .tile-img, .t-adlens .tile-img { flex: none; aspect-ratio: 16 / 10; min-height: 0; }
  .posters {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 74%;
    overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px;
    margin-inline: -16px; padding: 0 16px 8px; scroll-padding-inline: 16px; scrollbar-width: none;
  }
  .posters::-webkit-scrollbar { display: none; }
  .posters li { scroll-snap-align: start; }
  .principles { grid-template-columns: 1fr; gap: 28px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .closing-inner .btn { width: 100%; }
}
