/* pomtap.app
   Kural: her renk, aralık, yazı boyu, köşe, kontur, gölge ve süre :root'taki bir token'dan gelir.
   Bileşen kuralları yalnız token okur. Kırılımlarda (≤ 1024 px, ≤ 760 px) YALNIZ token değişir.
   Renkler oyunun B tasarımından (scenes/ui/theme_util.gd): krem zemin, mürekkep kontur, sert gölge, nar kırmızısı, altın. */

@font-face {
  font-family: "Nar Display";
  src: url("../fonts/nar-display.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Rubik";
  src: url("../fonts/rubik.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* renk */
  --c-cream: #FFF1C9;
  --c-ink: #2A1A1F;
  --c-muted: #5A4148;
  --c-red: #C1121F;
  --c-gold: #FFC93C;
  --c-gold-soft: #FFE7A3;
  --c-mint: #6FD3B0;
  --c-mint-line: #8FE0C3;
  --c-card: #FFFFFF;
  --c-on-ink: #FFF1C9;
  --c-on-ink-muted: #CDB8B0;
  --c-none: transparent;

  /* yazı */
  --f-display: "Nar Display", "Arial Rounded MT Bold", system-ui, sans-serif;
  --f-body: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-hero: 58px;
  --fs-h1-page: 44px;
  --fs-h2: 40px;
  --fs-h3: 24px;
  --fs-store: 24px;
  --fs-lead: 19px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-tiny: 12px;
  --lh-tight: 1.04;
  --lh-snug: 1.2;
  --lh-body: 1.55;
  --lh-one: 1;
  --fw-body: 500;
  --fw-strong: 700;
  --fw-display: 400;
  --ls-caps: 0.04em;
  --measure: 44ch;
  --measure-card: 40ch;
  --measure-prose: 66ch;

  /* aralık (4 px ızgarası) */
  --sp-0: 0;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 72px;
  --sp-9: 104px;
  --gutter: 24px;
  --wrap: 1140px;
  --wrap-prose: 760px;

  /* köşe, kontur, gölge: kalın mürekkep kontur + bulanıksız alt gölge (oyundaki gibi) */
  --r-card: 18px;
  --r-btn: 14px;
  --r-pill: 999px;
  --r-phone: 34px;
  --r-screen: 24px;
  --r-app: 22%;
  --stroke: 3px;
  --stroke-thin: 2px;
  --shadow-y: 4px;
  --shadow-y-lg: 7px;
  --press: 2px;
  --focus-gap: 4px;
  --offscreen: -200%;

  /* ölçü */
  --header-h: 76px;
  --logo-h: 52px;
  --logo-h-foot: 40px;
  --app-icon: 88px;
  --phone-w: 248px;
  --phone-w-sm: 240px;
  --phone-pad: 7px;
  --phone-ratio: 405 / 720;
  --tile: 46px;
  --tile-line: 2px;
  --tile-offset: -1px;
  --icon-step: 72px;
  --icon-feat: 64px;
  --store-w: 176px;
  --hero-art-h: 540px;
  --tilt-back: -5deg;
  --tilt-front: 4deg;
  --line-inset: 10%;

  /* yerleşim (kırılımlarda yalnız bunlar değişir) */
  --hero-cols: minmax(0, 1fr) minmax(0, 1fr);
  --hero-gap: var(--sp-7);
  --hero-pad-top: var(--sp-6);
  --steps-cols: repeat(5, minmax(0, 1fr));
  --steps-line: block;
  --step-cols: minmax(0, 1fr);
  --step-img-rows: auto;
  --feat-cols: minmax(0, 1.25fr) minmax(0, 1fr);
  --feat-rows: auto auto;
  --feat-span: 1 / span 2;
  --feat-big-cols: minmax(0, 1fr) auto;
  --feat-pad: var(--sp-6);
  --shots-cols: repeat(3, var(--phone-w-sm));
  --shots-justify: space-between;
  --foot-dir: row;
  --foot-align: center;
  --back-x: 9%;
  --front-x: 44%;
  --front-y: 70px;
  --tiles-top: var(--sp-7);
  --section-pad: var(--sp-9);
  --card-pad: var(--sp-7);

  /* hareket */
  --dur-fast: 120ms;
  --dur-intro: 720ms;
  --dur-drop: 900ms;
  --stagger: 70ms;
  --delay-art: 180ms;
  --delay-art-2: 300ms;
  --ease-out: cubic-bezier(.33, 1, .68, 1);
  --ease-drop: cubic-bezier(.22, .9, .3, 1);
  --rise: 24px;
  --drop-from: -64px;
  --squash-x: 1.14;
  --squash-y: 0.86;
  --rebound-x: 0.96;
  --rebound-y: 1.04;
}

@media (max-width: 1024px) {
  :root {
    --fs-hero: 46px;
    --phone-w: 200px;
    --phone-w-sm: 210px;
    --hero-art-h: 470px;
    --steps-cols: repeat(3, minmax(0, 1fr));
    --steps-line: none;
    --feat-big-cols: minmax(0, 1fr);
    --front-x: 40%;
  }
}

@media (max-width: 760px) {
  :root {
    --fs-hero: 38px;
    --fs-h1-page: 32px;
    --fs-h2: 30px;
    --fs-h3: 21px;
    --fs-store: 21px;
    --fs-lead: 17px;
    --gutter: 16px;
    --header-h: 64px;
    --logo-h: 38px;
    --logo-h-foot: 34px;
    --app-icon: 72px;
    --phone-w: 176px;
    --phone-w-sm: 200px;
    --tile: 36px;
    --icon-step: 56px;
    --store-w: 148px;
    --hero-art-h: 400px;
    --hero-cols: minmax(0, 1fr);
    --hero-gap: var(--sp-6);
    --hero-pad-top: var(--sp-3);
    --steps-cols: minmax(0, 1fr);
    --step-cols: var(--icon-step) minmax(0, 1fr);
    --step-img-rows: 1 / span 2;
    --feat-cols: minmax(0, 1fr);
    --feat-rows: auto;
    --feat-span: auto;
    --feat-pad: var(--sp-5);
    --shots-justify: start;
    --foot-dir: column;
    --foot-align: start;
    --back-x: 2%;
    --front-x: 40%;
    --front-y: 54px;
    --tiles-top: var(--sp-6);
    --section-pad: var(--sp-8);
    --card-pad: var(--sp-5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: var(--sp-0);
  background: var(--c-cream);
  color: var(--c-ink);
  font: var(--fw-body) var(--fs-body) / var(--lh-body) var(--f-body);
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: var(--sp-1); }
:focus-visible { outline: var(--stroke) solid var(--c-red); outline-offset: var(--focus-gap); border-radius: var(--r-btn); }

.skip {
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-0);
  transform: translateY(var(--offscreen));
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-ink);
  color: var(--c-on-ink);
  border-radius: var(--r-btn);
  font-weight: var(--fw-strong);
}
.skip:focus { transform: translateY(var(--sp-2)); }

.wrap {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* üst çubuk */
.top__in { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.brand { display: block; text-decoration: none; }
.brand img { height: var(--logo-h); width: auto; }
.lang {
  display: flex;
  border: var(--stroke) solid var(--c-ink);
  border-radius: var(--r-pill);
  background: var(--c-card);
  box-shadow: var(--sp-0) var(--shadow-y) var(--sp-0) var(--c-ink);
  overflow: hidden;
}
.lang a {
  font: var(--fw-strong) var(--fs-small) / var(--lh-one) var(--f-body);
  color: var(--c-ink);
  text-decoration: none;
  padding: var(--sp-2) var(--sp-4);
}
.lang a[aria-current="page"] { background: var(--c-ink); color: var(--c-on-ink); }
.lang a:focus-visible { outline-offset: calc(-1 * var(--stroke)); border-radius: var(--r-pill); }

/* başlıklar */
h1, h2, h3 { font-family: var(--f-display); font-weight: var(--fw-display); margin: var(--sp-0); text-wrap: balance; }
h1 { font-size: var(--fs-hero); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-tight); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-tight); }
p { margin: var(--sp-0); }
.lead { font-size: var(--fs-lead); color: var(--c-muted); max-width: var(--measure); }

/* giriş */
.hero { padding-block: var(--hero-pad-top) var(--sp-7); }
.hero__in { display: grid; grid-template-columns: var(--hero-cols); gap: var(--hero-gap); align-items: center; }
.hero__text { display: grid; gap: var(--sp-5); justify-items: start; min-width: 0; }
.app-icon {
  width: var(--app-icon);
  height: var(--app-icon);
  border: var(--stroke) solid var(--c-ink);
  border-radius: var(--r-app);
  box-shadow: var(--sp-0) var(--shadow-y) var(--sp-0) var(--c-ink);
  transform-origin: bottom center;
}
.hero__art { position: relative; height: var(--hero-art-h); min-width: 0; }
.tiles {
  position: absolute;
  inset: var(--tiles-top) var(--sp-0) var(--sp-5) var(--sp-0);
  border: var(--stroke) solid var(--c-ink);
  border-radius: var(--r-card);
  box-shadow: var(--sp-0) var(--shadow-y-lg) var(--sp-0) var(--c-ink);
  background-color: var(--c-mint);
  background-image:
    linear-gradient(var(--c-mint-line) var(--tile-line), var(--c-none) var(--tile-line)),
    linear-gradient(90deg, var(--c-mint-line) var(--tile-line), var(--c-none) var(--tile-line));
  background-size: var(--tile) var(--tile);
  background-position: var(--tile-offset) var(--tile-offset);
}
.hero__art .phone { position: absolute; top: var(--sp-0); }
.phone--back { left: var(--back-x); rotate: var(--tilt-back); }
.phone--front { left: var(--front-x); top: var(--front-y); rotate: var(--tilt-front); }

/* telefon çerçevesi */
.phone {
  margin: var(--sp-0);
  width: var(--phone-w);
  padding: var(--phone-pad);
  background: var(--c-ink);
  border-radius: var(--r-phone);
  box-shadow: var(--sp-0) var(--shadow-y-lg) var(--sp-0) var(--c-red);
}
.phone img { width: 100%; aspect-ratio: var(--phone-ratio); border-radius: var(--r-screen); }
.phone--sm { width: var(--phone-w-sm); box-shadow: var(--sp-0) var(--shadow-y) var(--sp-0) var(--c-ink); }

/* mağaza düğmeleri: uygulama henüz mağazada değil, bağlantı yok */
.stores { list-style: none; margin: var(--sp-0); padding: var(--sp-0); display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.store {
  display: grid;
  gap: var(--sp-1);
  min-width: var(--store-w);
  padding: var(--sp-3) var(--sp-5);
  border: var(--stroke) solid var(--c-ink);
  border-radius: var(--r-btn);
  background: var(--c-ink);
  color: var(--c-on-ink);
  box-shadow: var(--sp-0) var(--shadow-y) var(--sp-0) var(--c-red);
}
.store__state { font: var(--fw-strong) var(--fs-tiny) / var(--lh-one) var(--f-body); color: var(--c-gold); letter-spacing: var(--ls-caps); text-transform: uppercase; }
.store__name { font: var(--fw-display) var(--fs-store) / var(--lh-one) var(--f-display); }

/* yolculuk */
.journey { padding-block: var(--section-pad); }
.journey__in { display: grid; gap: var(--sp-7); }
.journey__head { display: grid; gap: var(--sp-3); }
.steps {
  list-style: none;
  margin: var(--sp-0);
  padding: var(--sp-0);
  display: grid;
  grid-template-columns: var(--steps-cols);
  gap: var(--sp-5);
  position: relative;
  counter-reset: step;
}
.steps::before {
  content: "";
  display: var(--steps-line);
  position: absolute;
  left: var(--line-inset);
  right: var(--line-inset);
  top: calc(var(--icon-step) / 2);
  border-top: var(--stroke) dashed var(--c-ink);
}
.step { position: relative; display: grid; grid-template-columns: var(--step-cols); gap: var(--sp-2) var(--sp-4); align-content: start; justify-items: start; min-width: 0; }
.step img { grid-row: var(--step-img-rows); width: var(--icon-step); height: var(--icon-step); background: var(--c-cream); border-radius: var(--r-pill); }
.step h3 { counter-increment: step; }
.step h3::before { content: counter(step) ". "; color: var(--c-red); }
.step p { color: var(--c-muted); font-size: var(--fs-small); }
.step--goal img { background: var(--c-gold); border: var(--stroke) solid var(--c-ink); }

/* özellikler: biri büyük, ikisi yanında */
.feats { padding-block: var(--sp-0) var(--section-pad); }
.feats__grid { display: grid; grid-template-columns: var(--feat-cols); grid-template-rows: var(--feat-rows); gap: var(--sp-5); }
.feat {
  display: grid;
  gap: var(--sp-3);
  align-content: start;
  padding: var(--feat-pad);
  border: var(--stroke) solid var(--c-ink);
  border-radius: var(--r-card);
  box-shadow: var(--sp-0) var(--shadow-y) var(--sp-0) var(--c-ink);
  background: var(--c-card);
  min-width: 0;
}
.feat .ic { width: var(--icon-feat); height: var(--icon-feat); padding: var(--sp-1); background: var(--c-card); border: var(--stroke) solid var(--c-ink); border-radius: var(--r-pill); }
.feat p { color: var(--c-muted); max-width: var(--measure-card); }
.feat--big { grid-row: var(--feat-span); background: var(--c-gold-soft); grid-template-columns: var(--feat-big-cols); align-content: stretch; gap: var(--sp-5); }
.feat--big .feat__text { display: grid; gap: var(--sp-3); align-content: start; }
.feat--big .phone { align-self: end; }
.feat--mint { background: var(--c-mint); }
.feat--mint p { color: var(--c-ink); }
.feat__fact { font: var(--fw-strong) var(--fs-small) / var(--lh-snug) var(--f-body); }
.feat--mint .feat__fact { color: var(--c-ink); }

/* ekranlar */
.shots { padding-block: var(--sp-0) var(--section-pad); }
.shots__in { display: grid; gap: var(--sp-6); }
.shots__row {
  list-style: none;
  margin: var(--sp-0);
  display: grid;
  grid-template-columns: var(--shots-cols);
  justify-content: var(--shots-justify);
  gap: var(--sp-6);
  overflow-x: auto;
  padding: var(--sp-0) var(--sp-0) var(--sp-4);
  scroll-snap-type: x mandatory;
}
.shot { margin: var(--sp-0); display: grid; gap: var(--sp-3); scroll-snap-align: start; }
.shot figcaption { font-size: var(--fs-small); font-weight: var(--fw-strong); }

/* yazı sayfası (gizlilik) */
.page { padding-block: var(--sp-6) var(--section-pad); }
.page .wrap { max-width: calc(var(--wrap-prose) + 2 * var(--gutter)); }
.card {
  padding: var(--card-pad);
  border: var(--stroke) solid var(--c-ink);
  border-radius: var(--r-card);
  box-shadow: var(--sp-0) var(--shadow-y-lg) var(--sp-0) var(--c-ink);
  background: var(--c-card);
}
.prose { display: grid; gap: var(--sp-4); }
.prose h1 { font-size: var(--fs-h1-page); }
.prose h2 { font-size: var(--fs-h3); line-height: var(--lh-snug); margin-top: var(--sp-5); color: var(--c-red); scroll-margin-top: var(--sp-5); }
.prose p { max-width: var(--measure-prose); }
.prose a { color: var(--c-red); font-weight: var(--fw-strong); }
.prose .date { color: var(--c-muted); font-size: var(--fs-small); }
.back { display: inline-block; margin-top: var(--sp-6); font-weight: var(--fw-strong); }

/* yok sayfası */
.lost { display: grid; gap: var(--sp-5); justify-items: start; padding-block: var(--sp-8) var(--section-pad); }
.lost__links { display: flex; flex-wrap: wrap; gap: var(--sp-5); font-weight: var(--fw-strong); }

/* alt */
.foot { background: var(--c-ink); color: var(--c-on-ink); padding-block: var(--sp-7); }
.foot__in { display: flex; flex-direction: var(--foot-dir); align-items: var(--foot-align); justify-content: space-between; gap: var(--sp-5); }
.foot .brand img { height: var(--logo-h-foot); }
.foot nav { display: flex; flex-wrap: wrap; gap: var(--sp-5); font-size: var(--fs-small); font-weight: var(--fw-strong); }
.foot a { color: var(--c-on-ink); }
.foot :focus-visible { outline-color: var(--c-gold); }
.foot small { color: var(--c-on-ink-muted); font-size: var(--fs-tiny); }

/* giriş hareketi (marka açılışı Fikir 1'in ilk vuruşu: nar düşer, ezilir, toparlanır). Hareket azaltma açıksa hiç oynamaz. */
@media (prefers-reduced-motion: no-preference) {
  .hero .app-icon { animation: drop var(--dur-drop) var(--ease-drop) both; }
  .hero__text > :not(.app-icon) { animation: rise var(--dur-intro) var(--ease-out) both; }
  .hero__text > :nth-child(2) { animation-delay: calc(1 * var(--stagger)); }
  .hero__text > :nth-child(3) { animation-delay: calc(2 * var(--stagger)); }
  .hero__text > :nth-child(4) { animation-delay: calc(3 * var(--stagger)); }
  .hero__art .tiles { animation: rise var(--dur-intro) var(--ease-out) both; }
  .hero__art .phone--back { animation: rise var(--dur-intro) var(--ease-out) var(--delay-art) both; }
  .hero__art .phone--front { animation: rise var(--dur-intro) var(--ease-out) var(--delay-art-2) both; }
  .lang a { transition: background-color var(--dur-fast) var(--ease-out); }
}

@keyframes drop {
  0% { opacity: 0; transform: translateY(var(--drop-from)); }
  45% { opacity: 1; transform: translateY(var(--sp-0)) scale(var(--squash-x), var(--squash-y)); }
  70% { transform: scale(var(--rebound-x), var(--rebound-y)); }
  100% { transform: none; }
}
@keyframes rise {
  from { opacity: 0; translate: var(--sp-0) var(--rise); }
  to { opacity: 1; translate: var(--sp-0) var(--sp-0); }
}
