/* ══════════════════════════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════════════════════════ */
:root {
  /* Background & ink */
  --bg:            #000000;
  --on-bg:         #ffffff;
  --muted:         #888888;

  /* Surface */
  --surface-bg:    rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --surface-border:rgba(255, 255, 255, 0.09);

  /* Accent colours — dark mode */
  --green-accent:       #66bb6a;
  --green-section-bg:   rgba(27, 94, 32, 0.22);
  --yellow-accent:      #fdd835;
  --yellow-section-bg:  rgba(245, 127, 23, 0.14);
  --red-accent:         #ef9a9a;
  --red-section-bg:     rgba(183, 28, 28, 0.22);
  --blue-accent:        #4fc3f7;
  --blue-section-bg:    rgba(1, 87, 155, 0.22);

  /* Layout */
  --max-w:      1240px;
  --nav-h:      68px;
  --pad-h:      44px;
  --section-min: 760px;

  /* Radii */
  --r-pill: 9999px;
  --r-xl:   32px;
  --r-lg:   22px;
  --r-md:   14px;
  --r-sm:    8px;

  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Cursor */
  --cursor-accent: var(--on-bg);
}

/* Light mode overrides */
[data-theme="light"] {
  --bg:            #ffffff;
  --on-bg:         #000000;
  --muted:         #555555;
  --surface-bg:    rgba(0, 0, 0, 0.03);
  --surface-hover: rgba(0, 0, 0, 0.05);
  --surface-border:rgba(0, 0, 0, 0.08);

  --green-accent:      #2e7d32;
  --green-section-bg:  rgba(165, 214, 167, 0.22);
  --yellow-accent:     #e65100;
  --yellow-section-bg: rgba(255, 241, 118, 0.28);
  --red-accent:        #b71c1c;
  --red-section-bg:    rgba(239, 154, 154, 0.22);
  --blue-accent:       #0277bd;
  --blue-section-bg:   rgba(129, 212, 250, 0.22);
}

[data-cursor-section="deenly"]       { --cursor-accent: var(--green-accent); }
[data-cursor-section="tomatly"]      { --cursor-accent: var(--red-accent); }
[data-cursor-section="learnly"]      { --cursor-accent: var(--blue-accent); }
[data-cursor-section="clean-future"] { --cursor-accent: var(--yellow-accent); }
[data-cursor-section="archive"]      { --cursor-accent: var(--on-bg); }

/* ══════════════════════════════════════════════════════════
   RESET
══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-x: hidden;           /* moved from body — keeps body from becoming scroll container in Safari */
  scroll-padding-top: var(--nav-h);
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: none;
  scrollbar-width: none;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--on-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

html.is-free-scroll,
html.is-viewport-free-scroll,
body.is-free-scroll {
  scroll-snap-type: none;
  overscroll-behavior-y: auto;
}

body.is-viewport-free-scroll {
  scroll-snap-type: none;
  overscroll-behavior-y: auto;
}

img   { max-width: 100%; height: auto; display: block; }
a     { color: inherit; text-decoration: none; }
ul    { list-style: none; }
button{ cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }

/* ══════════════════════════════════════════════════════════
   CUSTOM CURSOR
══════════════════════════════════════════════════════════ */
.custom-cursor {
  position: fixed;
  inset: 0 auto auto 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.custom-cursor.is-visible { opacity: 1; }

.custom-cursor-dot,
.custom-cursor-ring,
.custom-cursor-icon {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  transform: translate3d(-80px, -80px, 0);
  will-change: transform;
}

.custom-cursor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cursor-accent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--cursor-accent) 70%, transparent);
  transition: width 0.18s ease, height 0.18s ease, background 0.2s ease, opacity 0.18s ease;
}

.custom-cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--cursor-accent) 78%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--cursor-accent) 6%, transparent);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: width 0.18s ease, height 0.18s ease, border-color 0.2s ease, background 0.2s ease;
}

.custom-cursor-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cursor-accent);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.14s ease, color 0.2s ease;
}

html.cursor-hover .custom-cursor-dot {
  width: 4px;
  height: 4px;
  opacity: 0.9;
}

html.cursor-hover .custom-cursor-ring {
  width: 50px;
  height: 50px;
  border-color: var(--cursor-accent);
  background: color-mix(in srgb, var(--cursor-accent) 12%, transparent);
}

html.cursor-hover .custom-cursor-icon {
  width: 50px;
  height: 50px;
  opacity: 1;
}

html.cursor-pressed .custom-cursor-ring {
  width: 42px;
  height: 42px;
}

@media (hover: hover) and (pointer: fine) {
  html.cursor-ready,
  html.cursor-ready body,
  html.cursor-ready a,
  html.cursor-ready button,
  html.cursor-ready .btn,
  html.cursor-ready [role="button"] {
    cursor: none;
  }
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .custom-cursor {
    display: none;
  }
}

/* Shared nav/footer styles live in nav-footer.css. */
[data-theme="light"] .nav-logo-img {
  content: url("assets/logo-black.png");
}

/* ══════════════════════════════════════════════════════════
   SHARED SECTION
══════════════════════════════════════════════════════════ */
.section {
  background-color: var(--bg);
  transition: background-color 0.3s ease;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.section-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--pad-h);
  padding-right: var(--pad-h);
}

/* Section mark (number + line) */
.section-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.section-number {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-line {
  display: block;
  width: 28px;
  height: 1.5px;
  background: var(--muted);
  opacity: 0.5;
  border-radius: 4px;
}

/* Status pill */
.status-pill {
  display: inline-block;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.status-pill-muted {
  color: var(--muted);
  background: color-mix(in srgb, var(--on-bg) 8%, transparent);
}

/* Headings */
.section-title {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin-bottom: 18px;
}

/* Body text */
.body-lg  { font-size: 17px; line-height: 1.65; margin-bottom: 16px; }
.body-md  { font-size: 15px; line-height: 1.72; }
.muted    { color: var(--muted); }

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.12s;
  text-decoration: none;
  user-select: none;
}
.btn:hover  { opacity: 0.82; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-filled  { background: var(--on-bg); color: var(--bg); }
.btn-outline {
  background: var(--surface-bg);
  color: var(--on-bg);
  border: 1px solid var(--surface-border);
}
.btn-outline:hover { background: var(--surface-hover); }

.btn-sm { padding: 9px 16px; font-size: 13px; }

.btn.disabled {
  opacity: 0.32;
  cursor: not-allowed;
  pointer-events: none;
}

.is-release-disabled {
  opacity: 0.34;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.25);
}

/* ══════════════════════════════════════════════════════════
   INTRO SECTION
══════════════════════════════════════════════════════════ */
.intro-section {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
}
.intro-section .section-container {
  width: 100%;
  padding-top: 140px;
  padding-bottom: 64px;
}

.intro-content {
  display: flex;
  align-items: center;
  gap: 48px;
}

.intro-text   { flex: 1; max-width: 720px; }
.intro-visual { flex: 1; }

.name-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--on-bg) 8%, transparent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.display-xl {
  font-size: 72px;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}

.lead {
  font-size: 21px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
  max-width: 600px;
}


/* ══════════════════════════════════════════════════════════
   PRODUCT SECTIONS
══════════════════════════════════════════════════════════ */
.product-section {
  min-height: var(--section-min);
  display: flex;
  align-items: center;
}
.product-section .section-container { width: 100%; }

.product-layout {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 80px 0;
  width: 100%;
}
.product-layout-reversed { flex-direction: row-reverse; }

.product-copy   { flex: 10 1 0; min-width: 0; }
.product-visual { flex: 11 1 0; display: flex; justify-content: center; align-items: center; min-width: 0; }

/* ── Upcoming icon visual (Deenly / Tomatly / Learnly) ── */
.upcoming-outer {
  width: 420px;
  height: 420px;
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--upcoming-accent, var(--on-bg)) 9%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.upcoming-inner {
  width: 220px;
  height: 220px;
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--upcoming-accent, var(--on-bg)) 10%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px;
}
.upcoming-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 24px;
}

/* ── Clean Future inline screenshot ── */
.clean-future-inline-media {
  margin-top: 18px;
  margin-bottom: 18px;
}
.clean-future-inline-shot {
  width: min(360px, 100%);
  border-radius: var(--r-lg);
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

/* ══════════════════════════════════════════════════════════
   ARCHIVE SECTION
══════════════════════════════════════════════════════════ */
.archive-section {
  --archive-footer-h: 122px;
  min-height: var(--section-min);
  position: relative;
}
.archive-section .section-container {
  height: calc(100% - var(--archive-footer-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-h);
  padding-bottom: 24px;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.archive-card {
  min-width: 0;
  min-height: 84px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  cursor: pointer;
}
.archive-card:hover,
.archive-card:focus-visible { background: var(--surface-hover); }
.archive-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--on-bg) 24%, transparent);
  outline-offset: 3px;
}

.archive-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
  margin-bottom: 0;
  flex: 0 0 auto;
}
.archive-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.archive-card-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
}

.archive-card .action-row {
  margin-top: 0;
  margin-left: auto;
  flex: 0 0 auto;
}

.archive-github {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  font-size: 15px;
  background: transparent;
  color: var(--muted);
  border: 0;
}
.archive-card:hover .archive-github,
.archive-card:focus-visible .archive-github {
  color: var(--on-bg);
  background: transparent;
  opacity: 1;
}

#archive .footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin-top: 0;
  padding: 22px 0 24px;
}

.footer {
  scroll-snap-align: end;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — tablet (760–1119px)
══════════════════════════════════════════════════════════ */
@media (max-width: 1119px) {
  :root { --pad-h: 30px; }

  .display-xl    { font-size: 58px; }
  .section-title { font-size: 44px; }
  .lead          { font-size: 19px; }

  .upcoming-outer { width: 340px; height: 340px; }
  .upcoming-inner { width: 180px; height: 180px; padding: 28px; }

  .branding-visual { width: 380px; }
}

@media (min-width: 760px) and (max-height: 820px) {
  .archive-section {
    --archive-footer-h: 110px;
  }

  .archive-section .section-container {
    padding-top: var(--nav-h);
    padding-bottom: 16px;
  }

  #archive .section-mark {
    margin-bottom: 12px;
  }

  #archive .section-title {
    font-size: 40px;
    margin-bottom: 10px;
  }

  #archive .body-lg {
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 0;
  }

  .archive-grid {
    gap: 10px;
    margin-top: 16px;
  }

  .archive-card {
    min-height: 68px;
    padding: 10px;
    gap: 10px;
  }

  .archive-icon-wrap {
    width: 42px;
    height: 42px;
    padding: 8px;
  }

  .archive-card-title {
    font-size: 15px;
  }

  .archive-card .action-row {
    margin-top: 0;
  }

  #archive .footer {
    padding: 16px 0 18px;
  }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — mobile (< 760px)
══════════════════════════════════════════════════════════ */
@media (max-width: 759px) {
  :root {
    --nav-h:  60px;
    --pad-h:  20px;
    --section-min: 100svh;
  }

  /* Mobilde tüm sectionlar içerik yüksekliğinde, en az 100svh */
  .section {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    overflow: visible;
  }

  /* Story panel aktif sectionlarda içerik logonun altına girmesin */
  #intro .section-container,
  #deenly .section-container,
  #tomatly .section-container,
  #learnly .section-container {
    padding-bottom: calc(30vh + 24px);
    padding-bottom: calc(30svh + 24px);
  }

  /* Intro */
  .intro-section { min-height: 100vh; min-height: 100svh; align-items: flex-start; }
  .intro-section .section-container { padding-top: 110px; padding-bottom: 56px; }
  .intro-content {
    flex-direction: column;
    gap: 36px;
  }
  .intro-text   { max-width: 100%; }
  .intro-visual { justify-content: center; width: 100%; flex: none; }
  .branding-visual { width: 200px; }
  .display-xl    { font-size: 42px; }
  .lead          { font-size: 17px; }

  /* Products */
  .product-layout,
  .product-layout-reversed {
    flex-direction: column !important;
    gap: 36px;
    padding: 48px 0;
  }
  .product-copy, .product-visual { flex: none; width: 100%; max-width: 100%; }
  .section-title   { font-size: 34px; }
  .body-lg         { font-size: 16px; }

  /* Upcoming visual */
  .upcoming-outer { width: 300px; height: 300px; }
  .upcoming-inner { width: 162px; height: 162px; padding: 24px; }

  /* Clean Future */
  .cf-row { flex-direction: column; }

  /* Archive */
  .archive-section .section-container {
    height: auto;
    display: block;
    padding-top: 48px;
    padding-bottom: 0;
  }

  .archive-grid {
    grid-template-columns: 1fr;
  }

  .archive-card {
    width: 100%;
  }

  #archive .footer {
    position: static;
    padding: 40px 0 48px;
    margin-top: 40px;
  }
}

/* ── Countdown card (Deenly section) ── */
.countdown-card {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 18px;
  border-radius: var(--r-lg);
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  margin-bottom: 18px;
}
.countdown-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.countdown-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--green-accent);
}

/* ══════════════════════════════════════════════════════════
   STORY PANEL  (single fixed image, right side desktop / bottom mobile)
══════════════════════════════════════════════════════════ */
#story-panel {
  position: fixed;
  right: 0;
  top: var(--nav-h);
  bottom: 0;
  width: 47%;
  height: calc(100vh - var(--nav-h));
  height: calc(100svh - var(--nav-h));
  overflow: hidden;
  clip-path: inset(0);          /* Safari: overflow:hidden doesn't clip fixed+transformed children */
  pointer-events: none;
  z-index: 5;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Her frame paneli tamamen kaplıyor — böylece translateY(101%) panel yüksekliği kadar kayar */
.story-frame {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  transform: translate3d(0, 101%, 0);
  -webkit-transform: translate3d(0, 101%, 0);
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.story-frame.is-active {
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

/* Görseller: vh bazlı yükseklik, üst köşe yuvarlak */
.story-img {
  height: 43vh;
  width: auto;
  max-width: 92%;
  display: block;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  opacity: 1;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
.story-img--tall { height: 47vh; }
.story-img--pixel {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.story-sprite {
  --story-sprite-h: 43vh;
  width: min(calc(var(--story-sprite-h) * var(--story-sprite-ratio)), 92%);
  aspect-ratio: var(--story-sprite-ratio);
  overflow: hidden;
  display: block;
  background-image: var(--story-sprite-url);
  background-repeat: no-repeat;
  background-size: 200% 100%;
  background-position: 0% 0%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: story-sprite-idle 1s step-end infinite;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
@keyframes story-sprite-idle {
  0%, 49.999% { background-position: 0% 0%; }
  50%, 100% { background-position: 100% 0%; }
}

/* Light / dark mod geçişi (sadece 1. ve 2. frame) */
.story-img--light { display: none; }
[data-theme="light"] .story-img--dark  { display: none; }
[data-theme="light"] .story-img--light { display: block; }
.story-sprite--light { display: none; }
[data-theme="light"] .story-sprite--dark  { display: none; }
[data-theme="light"] .story-sprite--light { display: block; }

/* ── Mobile ── */
@media (max-width: 759px) {
  #story-panel {
    left: 0;
    right: 0;
    width: 100%;
    top: auto;
    bottom: 0;
    height: 30vh;
    height: 30svh;
  }
  .story-frame    { justify-content: center; }
  .story-img      { height: 26vh; max-width: 60%; }
  .story-img--tall{ height: 28vh; }
  .story-sprite   { --story-sprite-h: 26vh; width: min(calc(var(--story-sprite-h) * var(--story-sprite-ratio)), 60%); }
}

/* ══════════════════════════════════════════════════════════
   REVEAL ANIMATION
══════════════════════════════════════════════════════════ */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  transition-delay: var(--reveal-delay, 0s);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════
   SELECTION
══════════════════════════════════════════════════════════ */
::selection {
  background: color-mix(in srgb, var(--on-bg) 15%, transparent);
}
