/* =====================================================================
   GulByte — styles.css
   ---------------------------------------------------------------------
   1. Design tokens (colors, type, spacing) — edit these first
   2. Base / layout
   3. Header & hero
   4. Cards & sections
   5. Footer, 404
   6. Motion preferences
   No external fonts: everything uses the system font stack.
   ===================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Dark theme (default) */
  --bg: #0b0a10;            /* deep ink page background */
  --bg-raised: #14121c;     /* slightly lifted surfaces */
  --text: #f4eef4;          /* body text */
  --text-muted: #aba3b6;    /* secondary text (AA on --bg) */
  --rose: #e8457a;          /* primary accent (brand rose) */
  --rose-soft: #ff8fb1;     /* lighter rose for highlights */
  --rose-text: #ff7aa3;     /* rose used for text — AA on --bg */
  --cool: #4fd8c4;          /* secondary cool accent (teal) */
  --cool-text: #5fe0cc;     /* teal used for text — AA on --bg */
  --on-accent: #16050c;     /* text on rose buttons */

  --card-bg: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.10);
  --card-border-hover: rgba(255, 143, 177, 0.35);
  --card-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
  --glow-a: rgba(232, 69, 122, 0.22);   /* hero glow, rose */
  --glow-b: rgba(79, 216, 196, 0.12);   /* hero glow, teal */
  --grid-dot: rgba(255, 255, 255, 0.05);
  --focus: #5fe0cc;

  /* Background tile animation colors (read by main.js) */
  --tile-a: 232, 69, 122;   /* rose as R,G,B */
  --tile-b: 79, 216, 196;   /* teal as R,G,B */
  --tile-alpha: 0.10;       /* base opacity — keep low for readability */

  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --maxw: 68rem;
  --radius: 22px;
  --radius-sm: 12px;
  --gutter: clamp(1rem, 4vw, 2rem);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbf7f9;
    --bg-raised: #ffffff;
    --text: #17131d;
    --text-muted: #5b5466;
    --rose: #e8457a;
    --rose-soft: #ff8fb1;
    --rose-text: #b8245a;
    --cool: #1fa594;
    --cool-text: #0b7468;
    --on-accent: #ffffff;

    --card-bg: rgba(255, 255, 255, 0.62);
    --card-border: rgba(23, 19, 29, 0.10);
    --card-border-hover: rgba(184, 36, 90, 0.35);
    --card-shadow: 0 10px 30px -14px rgba(60, 20, 40, 0.25);
    --glow-a: rgba(232, 69, 122, 0.16);
    --glow-b: rgba(31, 165, 148, 0.10);
    --grid-dot: rgba(23, 19, 29, 0.06);
    --focus: #b8245a;

    --tile-a: 232, 69, 122;
    --tile-b: 31, 165, 148;
    --tile-alpha: 0.09;
  }
}

/* ---------- 2. Base / layout ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  /* static dot grid — always on, even with reduced motion */
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1.5px);
  background-size: 28px 28px;
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-sans);
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 0.5em;
}
h2 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
h3 { font-size: 1.4rem; font-weight: 750; }
p { margin: 0 0 1em; }

a { color: var(--rose-text); text-underline-offset: 0.2em; }
a:hover { color: var(--rose-soft); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Visually hidden, still read by screen readers */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--rose-text);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

/* Animated background canvas (drawn by main.js).
   Masked so tiles fade out toward the centre where the text sits. */
.bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(0,0,0,.35), #000 85%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(0,0,0,.35), #000 85%);
}

.accent-text {
  background: linear-gradient(100deg, var(--rose) 15%, var(--rose-soft) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted { color: var(--text-muted); font-weight: 500; }

.eyebrow {
  margin: 0 0 0.5rem;
  font: 600 0.8rem/1.2 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cool-text);
}

/* ---------- 3. Header & hero ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--card-border);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font: 800 1.2rem/1 var(--font-display);
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 1.75rem; height: 1.75rem; }

.nav {
  display: flex;
  gap: clamp(0.25rem, 2vw, 1.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--text); background: var(--card-bg); }

/* Right side of the header: page nav + EN/TR switch */
.header-end {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1rem);
}

/* Language switch (plain links, no JS or cookies) */
.lang {
  display: flex;
  margin: 0;
  padding: 2px;
  list-style: none;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card-bg);
}
.lang a {
  display: block;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font: 600 0.78rem/1.2 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-decoration: none;
}
.lang a:hover { color: var(--text); }
.lang a[aria-current="page"] {
  color: var(--rose-text);
  background: color-mix(in srgb, var(--rose) 16%, transparent);
}

/* Very narrow phones: keep the mark, visually hide the header wordmark
   (still read by screen readers via the link's aria-label). */
/* Phones: drop the section links (the hero buttons and scrolling cover
   them) so the logo and the EN/TR switch always fit on one row. */
@media (max-width: 38rem) {
  .nav { display: none; }
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: clamp(4rem, 12vh, 8rem) clamp(3rem, 10vh, 6rem);
  scroll-margin-top: 4rem;
}
/* soft glow behind the logo */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 32rem;
  z-index: -1;
  background:
    radial-gradient(22rem 16rem at 50% 30%, var(--glow-a), transparent 70%),
    radial-gradient(18rem 14rem at 64% 52%, var(--glow-b), transparent 70%);
  pointer-events: none;
}

.hero-mark {
  width: clamp(5.5rem, 16vw, 8rem);
  height: clamp(5.5rem, 16vw, 8rem);
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 8px 30px rgba(232, 69, 122, 0.35));
}

.hero-title {
  font-size: clamp(3.25rem, 13vw, 7.5rem);
  font-weight: 850;
  letter-spacing: -0.05em;
  line-height: 0.95;
  margin-bottom: 0.25em;
}

.tagline {
  font: 700 clamp(1.35rem, 3.6vw, 2rem)/1.2 var(--font-display);
  letter-spacing: -0.015em;
  margin-bottom: 0.6em;
}

.lede {
  max-width: 34rem;
  color: var(--text-muted);
  font-size: clamp(1.02rem, 2.2vw, 1.15rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn-primary {
  background: var(--rose);
  color: var(--on-accent);
  box-shadow: 0 8px 24px -8px rgba(232, 69, 122, 0.6);
}
.btn-primary:hover { color: var(--on-accent); background: var(--rose-soft); transform: translateY(-2px); }
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover { color: var(--text); border-color: var(--card-border-hover); transform: translateY(-2px); }

@media (prefers-color-scheme: light) {
  /* darker roses keep the gradient wordmark above 3:1 on the light background */
  .accent-text { background-image: linear-gradient(100deg, var(--rose-text) 15%, var(--rose) 95%); }
  .btn-primary { background: var(--rose-text); }
  .btn-primary:hover { background: #9c1b4b; }
}

/* ---------- 4. Cards & sections ---------- */
.section {
  padding-block: clamp(3rem, 8vw, 5.5rem);
  scroll-margin-top: 4rem;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}
@media (min-width: 52rem) {
  .cards { grid-template-columns: 1.6fr 1fr; }
}

.card {
  position: relative;
  padding: clamp(1.4rem, 3.5vw, 2.25rem);
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover);
}
.card p { color: var(--text-muted); }
.card p:last-of-type { margin-bottom: 0; }

.card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font: 600 0.8rem/1.4 var(--font-mono);
  color: var(--rose-text);
  background: color-mix(in srgb, var(--rose) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--rose) 35%, transparent);
}
.badge .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 0 rgba(232, 69, 122, 0.6);
  animation: pulse 2.4s ease-out infinite;
}
.badge-muted {
  color: var(--text-muted);
  background: transparent;
  border-color: var(--card-border);
}
.platform {
  font: 500 0.85rem/1.4 var(--font-mono);
  color: var(--text-muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cool-text);
  border: 1px solid color-mix(in srgb, var(--cool) 35%, transparent);
  background: color-mix(in srgb, var(--cool) 9%, transparent);
}

/* Decorative mini board on the puzzle card */
.mini-board {
  --gap: 6px;
  --cell: calc((100% - 3 * var(--gap)) / 4);
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  width: min(100%, 11rem);
  aspect-ratio: 1;
  margin-bottom: 1.5rem;
}
.mini-board i,
.mini-board .slider {
  border-radius: 9px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.mini-board .t2 { background: var(--rose); animation: merge-target 6s ease-in-out infinite; }
.mini-board .t3 { background: color-mix(in srgb, var(--rose) 45%, transparent); }
.mini-board .t4 { background: color-mix(in srgb, var(--cool) 55%, transparent); }
.mini-board .t5 { background: var(--cool); }
.mini-board .slider {
  position: absolute;
  left: 0;
  top: calc(var(--cell) + var(--gap));
  width: var(--cell);
  aspect-ratio: 1;
  background: var(--rose);
  animation: slide-merge 6s ease-in-out infinite;
}

.card-placeholder {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.placeholder-tiles {
  display: flex;
  gap: 6px;
  margin-bottom: 1.5rem;
}
.placeholder-tiles i {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9px;
  border: 1.5px dashed color-mix(in srgb, var(--text) 22%, transparent);
}
.placeholder-tiles i:nth-child(2) { border-color: color-mix(in srgb, var(--cool) 40%, transparent); }

/* About */
.about {
  display: grid;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 52rem) {
  .about { grid-template-columns: 1.4fr 1fr; gap: 3rem; }
}
.about-text {
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  line-height: 1.6;
}
.about-text em { font-style: normal; color: var(--rose-text); font-weight: 600; }

.values {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.values li {
  display: grid;
  gap: 0.15rem;
  padding: 1rem 1.1rem 1rem 2.1rem;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  position: relative;
}
.values li::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 1.45rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  background: var(--rose);
}
.values li:nth-child(2)::before { background: var(--cool); }
.values span { color: var(--text-muted); font-size: 0.95rem; }

/* Contact */
.contact-card {
  text-align: center;
  padding-block: clamp(2.5rem, 6vw, 4rem);
  background:
    radial-gradient(ellipse 60% 70% at 50% 120%, var(--glow-a), transparent 70%),
    var(--card-bg);
}
.email {
  display: inline-block;
  margin-top: 0.5rem;
  font: 750 clamp(1.25rem, 5vw, 2.25rem)/1.2 var(--font-display);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-decoration-thickness: 2px;
}

/* ---------- 5. Footer, 404 ---------- */
.site-footer {
  border-top: 1px solid var(--card-border);
  padding-block: 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.footer-row p { margin: 0; }
.footer-links {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }

.notfound {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-block: 4rem;
}
.notfound .code {
  font: 850 clamp(4.5rem, 20vw, 9rem)/1 var(--font-display);
  letter-spacing: -0.05em;
  margin: 1rem 0 0.25rem;
  color: transparent; /* let the .accent-text gradient show */
}
.notfound h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
.notfound p { color: var(--text-muted); max-width: 28rem; }

/* ---------- 5b. Long-form pages (privacy, legal) ---------- */
.page { padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(3rem, 8vw, 5rem); }

.prose {
  max-width: 70ch;           /* comfortable reading width */
  margin-inline: auto;
  line-height: 1.7;
}
.prose h1 {
  font-size: clamp(2.4rem, 7vw, 3.75rem);
  font-weight: 850;
  letter-spacing: -0.04em;
  margin-bottom: 0.35em;
}
.prose h2 {
  font-size: clamp(1.35rem, 3vw, 1.6rem);
  font-weight: 750;
  letter-spacing: -0.015em;
  margin: 2.2em 0 0.55em;
  scroll-margin-top: 5rem;
}
.prose ul { margin: 0 0 1em; padding-left: 1.25em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--rose-text); }
.prose strong { font-weight: 650; }
.prose code {
  font: 0.88em/1 var(--font-mono);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  overflow-wrap: anywhere;
}
.prose .meta {
  font: 500 0.88rem/1.5 var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* "The short version" box: same glass card, but no hover lift (it's for reading) */
.summary { padding: clamp(1.25rem, 3.5vw, 1.75rem); }
.summary:hover { transform: none; border-color: var(--card-border); }
.summary h2 { margin-top: 0; font-size: 1.15rem; }
.prose .summary-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.summary-list li { position: relative; padding-left: 1.5rem; margin: 0; color: var(--text); }
.summary-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 3px;
  background: var(--rose);
}
.summary-list li:nth-child(even)::before { background: var(--cool); }

/* Retention table */
.facts {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
  line-height: 1.5;
}
.facts th, .facts td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.75rem 0.75rem 0;
  border-bottom: 1px solid var(--card-border);
}
.facts thead th {
  font: 600 0.75rem/1.2 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cool-text);
}
.facts tbody th { font-weight: 600; width: 55%; }
.facts td { color: var(--text-muted); padding-right: 0; }

.back { margin-top: 3rem; }
.footer-links a[aria-current="page"] { color: var(--text); }

/* ---------- 6. Motion ---------- */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 69, 122, 0.55); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(232, 69, 122, 0); }
}

/* slider: wait, slide right 3 cells, merge (fade into target), reappear */
@keyframes slide-merge {
  0%, 30% { transform: translateX(0); opacity: 1; }
  45% { transform: translateX(calc(300% + 3 * var(--gap))); opacity: 1; }
  50%, 85% { transform: translateX(calc(300% + 3 * var(--gap))) scale(.6); opacity: 0; }
  86% { transform: translateX(0) scale(.6); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes merge-target {
  0%, 44% { transform: scale(1); box-shadow: none; filter: none; }
  50% { transform: scale(1.14); box-shadow: 0 0 22px 2px rgba(255, 143, 177, 0.7); filter: brightness(1.25); }
  62%, 85% { transform: scale(1); box-shadow: 0 0 12px 0 rgba(255, 143, 177, 0.35); filter: brightness(1.15); }
  100% { transform: scale(1); box-shadow: none; filter: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .card:hover, .btn:hover { transform: none; }
  .bg { display: none; }
}
