:root {
  --bg: #080c14;
  --bg-raised: #0d131f;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.26);
  --text: #e6ebf2;
  --muted: #8d98a9;
  --faint: #5d6778;
  --accent: #3fa7d1;
  --accent-soft: rgba(63, 167, 209, 0.12);
  --brass: #c9a36a;
  --brass-soft: rgba(201, 163, 106, 0.12);

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

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

.skip {
  position: absolute; left: -9999px; top: 12px;
  background: var(--text); color: var(--bg); padding: 8px 14px; z-index: 100;
}
.skip:focus { left: 12px; }

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

.label {
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(8, 12, 20, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 500; letter-spacing: 0.01em;
}
.brand .brand-sig { width: auto; height: 34px; opacity: 0.68; transition: opacity .15s; }
.brand:hover .brand-sig, .brand:focus-visible .brand-sig { opacity: 1; }

.nav { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); font-size: clamp(0.8125rem, 2.4vw, 0.9375rem); }
.nav a { text-decoration: none; color: var(--muted); transition: color .15s; }
.nav a:hover { color: var(--text); }
.nav .lang {
  font: 500 0.75rem/1 var(--mono); letter-spacing: 0.08em;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 10px;
}
@media (max-width: 560px) {
  .nav .hide-sm { display: none; }
  /* AMOLED telefonlarda beyaz imza tam siyah zeminde daha parlak okunuyor */
  .brand .brand-sig { opacity: 0.55; }
}

/* ---------- hero ---------- */

.hero { position: relative; overflow: hidden; }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  min-height: min(760px, calc(100svh - 64px));
}
.hero-text { position: relative; z-index: 2; padding: 56px 0 72px; }
.hero h1 { margin: 50px 0 30px; line-height: 0; }
.hero-sig { width: clamp(240px, 34vw, 430px); height: auto; margin-left: -6px; }
.hero .lead { max-width: 34rem; color: #c3cbd7; font-size: clamp(1.0625rem, 1.6vw, 1.1875rem); margin: 0 0 30px; }
/* Sutun sutun dolar: 1-2 sol sutuna, 3-4 sag sutuna. Boylece HTML sirasi
   bozulmadan 1. madde 3. maddenin yanina gelir. */
.fields {
  display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column;
  justify-content: start; gap: 8px clamp(16px, 4vw, 32px);
  margin: 0; padding: 0; list-style: none;
}
.fields li { font: 400 clamp(0.75rem, 3vw, 0.875rem)/1.4 var(--mono); color: var(--muted); }
.fields li::before { content: "— "; color: var(--faint); }

.hero-photo { position: relative; align-self: stretch; margin-right: calc(var(--gutter) * -1); }
.hero-photo { margin: 0; }
.hero-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
  opacity: .45;
  /* vignette: the photo dissolves into the page on every side */
  -webkit-mask-image: radial-gradient(ellipse 56% 54% at 50% 48%, #000 30%, rgba(0, 0, 0, .55) 62%, transparent 100%);
          mask-image: radial-gradient(ellipse 56% 54% at 50% 48%, #000 30%, rgba(0, 0, 0, .55) 62%, transparent 100%);
}

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; min-height: 0; }
  .hero-photo { order: -1; height: 72vw; max-height: 460px; margin: 0 calc(var(--gutter) * -1); }
  .hero-text { padding: 0 0 56px; margin-top: -24px; }
}

/* Cok dar ekranda iki sutun sigmiyor, alt alta don. */
@media (max-width: 400px) {
  .fields { grid-template-rows: none; grid-auto-flow: row; }
}

/* ---------- sections ---------- */

section { scroll-margin-top: 64px; }
.section { padding: clamp(72px, 10vw, 120px) 0; border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px 48px; margin-bottom: 48px; }
.section-head h2 { font: 400 clamp(2.25rem, 4.5vw, 3.25rem)/1.05 var(--serif); margin: 0; }
.section-head p { color: var(--muted); max-width: 36rem; margin: 6px 0 0; }
.section-head .label { padding-top: 12px; }
@media (max-width: 820px) { .section-head { grid-template-columns: 1fr; gap: 14px; } .section-head .label { padding-top: 0; } }

/* ---------- work ---------- */

.work { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .work { grid-template-columns: 1fr; } }

.card {
  display: flex; flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  min-height: 300px;
}
.card .motif { height: 72px; color: var(--faint); margin-bottom: 36px; }
.card h3 { font: 500 1.1875rem/1.35 var(--sans); margin: 0 0 10px; }
.card p { color: var(--muted); margin: 0 0 28px; font-size: 1rem; }
.card .status { margin-top: auto; }

.status {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font: 500 0.75rem/1 var(--mono); letter-spacing: 0.04em;
  padding: 7px 11px; border-radius: 999px;
  color: var(--accent); background: var(--accent-soft);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.early { color: var(--brass); background: var(--brass-soft); }

.work-link {
  display: block; margin: -14px 0 26px;
  font-size: 0.9375rem; line-height: 1.45; color: var(--muted);
  text-decoration: none;
  transition: color .25s ease;
}
.work-link span { color: var(--accent); }
.work-link em {
  display: block; margin-top: 3px;
  font: 400 0.75rem/1 var(--mono); font-style: normal;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint);
}
.work-link:hover { color: var(--text); }
.work-link:hover span { text-decoration: underline; }

.aside-note { margin: 28px 0 0; color: var(--faint); font-size: 0.9375rem; }

/* ---------- background ---------- */

.about { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px 48px; }
.about-body { max-width: 40rem; }
.about-body p { margin: 0 0 1.2em; color: #c3cbd7; }
.about-title { font: 400 clamp(2rem, 4vw, 3rem)/1.1 var(--serif); margin: 0 0 28px; }
.about-title + p { font-size: clamp(1.0625rem, 1.6vw, 1.1875rem); line-height: 1.75; }
@media (max-width: 820px) { .about { grid-template-columns: 1fr; } }

.facts { margin: 40px 0 0; padding: 0; border-top: 1px solid var(--line); }
.facts div {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 4px 24px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.facts dt { font: 400 0.875rem/1.6 var(--mono); color: var(--faint); }
.facts dd { margin: 0; }
@media (max-width: 560px) { .facts div { grid-template-columns: 1fr; } }

/* ---------- contact ---------- */

.contact h2 { font: 400 clamp(2.5rem, 6vw, 4.25rem)/1.05 var(--serif); margin: 0 0 32px; max-width: 16ch; }
.contact p { color: var(--muted); max-width: 34rem; margin: 0 0 32px; }
.mail {
  display: inline-block;
  font: 400 clamp(1.125rem, 2.4vw, 1.5rem)/1.3 var(--mono);
  text-decoration: none;
  padding-bottom: 10px;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat;
  overflow-wrap: anywhere;
}
.mail:hover {
  color: var(--accent);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='8' viewBox='0 0 24 8'%3E%3Cpath d='M0 4q6-4 12 0t12 0' fill='none' stroke='%233fa7d1' stroke-width='1.2'/%3E%3C/svg%3E") 0 100% / 24px 8px repeat-x;
  animation: wave-run .7s linear infinite;
}
.social {
  display: flex; flex-wrap: wrap; gap: 14px;
  list-style: none; margin: 44px 0 0; padding: 0;
}
.social a {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted);
  transition: color .25s ease, border-color .25s ease, transform .25s ease, background-color .25s ease;
}
.social a:hover {
  color: var(--accent); border-color: rgba(63, 167, 209, 0.4);
  background: var(--accent-soft); transform: translateY(-2px);
}

/* Iletisim bolumundeki listeyle ayni olcude; tek fark rengin soluklugu.
   Ust bosluk 30px: paragraf-liste araligindan (36px) dar, boylece ikonlar
   listenin devami gibi okunuyor. Sol -12px optik hizalama: ilk simge 18px,
   buton 42px, yani simge kutunun icinde 12px iceride basliyor. */
.social-quiet { margin: 30px 0 0 -12px; }
.social-quiet a { color: var(--faint); border-color: rgba(148, 163, 184, 0.09); }

.copied {
  display: inline-block; margin-left: 16px;
  font: 400 0.8125rem/1 var(--mono); color: var(--muted);
  opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s;
}
.copied.show { opacity: 1; transform: none; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.site-footer small { font: 400 0.8125rem/1.5 var(--mono); color: var(--faint); }
.site-footer a { color: var(--muted); }

/* ==========================================================
   Motion
   ========================================================== */

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes photo-in { from { opacity: 0; transform: scale(1.03); } to { opacity: .45; transform: none; } }
@keyframes beam { from { opacity: .65; } to { opacity: 1; } }
@keyframes write { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@keyframes flash { from { opacity: .9; transform: scale(.4); } to { opacity: 0; transform: scale(2.6); } }
@keyframes rec { 0%, 100% { opacity: 1; box-shadow: 0 0 6px currentColor; } 50% { opacity: .35; box-shadow: 0 0 0 transparent; } }
@keyframes flow { to { transform: translateX(-114px); } }
@keyframes breathe-y { from { transform: scaleY(.55); } to { transform: scaleY(1.08); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes seq1 { 0% { transform: scaleX(0); } 14%, 86% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes seq2 { 0%, 14% { transform: scaleX(0); } 28%, 86% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes seq3 { 0%, 28% { transform: scaleX(0); } 42%, 86% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes seq4 { 0%, 42% { transform: scaleX(0); } 56%, 86% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes meter { 0% { transform: scaleY(.3); } 20% { transform: scaleY(.9); } 40% { transform: scaleY(.5); } 60% { transform: scaleY(1); } 80% { transform: scaleY(.4); } 100% { transform: scaleY(.75); } }
@keyframes wave-run { to { background-position: 24px 100%; } }
@keyframes heartbeat {
  0% { transform: translate(-50%, -50%) scale(1); }
  14% { transform: translate(-50%, -50%) scale(1.14); }
  28% { transform: translate(-50%, -50%) scale(1); }
  42% { transform: translate(-50%, -50%) scale(1.08); }
  70%, 100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes breathe { 50% { transform: translate(-50%, -50%) scale(1.05); } }

/* ---------- playhead ---------- */

.playhead { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; pointer-events: none; overflow-x: clip; }
.ph-track { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); }
.ph-fill {
  position: absolute; left: 0; top: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, rgba(63, 167, 209, 0.15), var(--accent));
  transform-origin: 0 50%; transform: scaleX(0);
}
.ph-head {
  position: absolute; left: 0; bottom: -4px; width: 1px; height: 9px;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
}
.ph-mark { position: absolute; left: 0; bottom: 0; width: 1px; height: 6px; background: var(--line-strong); transition: background-color .3s; }
.ph-mark i {
  position: absolute; left: 5px; bottom: 1px;
  font: 500 9px/1 var(--mono); font-style: normal; letter-spacing: 0.06em;
  color: var(--faint); transition: color .3s;
}
.ph-mark.end i { left: auto; right: 5px; }
.ph-mark.passed { background: var(--accent); }
.ph-mark.passed i { color: var(--muted); }
.ph-mark.current i { color: var(--accent); }
.ph-mark.flash::after {
  content: ""; position: absolute; left: -4px; bottom: -4px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--accent); animation: flash .9s ease-out forwards;
}

/* ---------- signature ---------- */

.js .sig-write {
  -webkit-mask-image: linear-gradient(100deg, #000 40%, transparent 60%);
          mask-image: linear-gradient(100deg, #000 40%, transparent 60%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
}
.js .hero .sig-write { animation: write 2.2s cubic-bezier(.55, 0, .25, 1) .3s forwards; }

.js .site-header .sig-write { animation: write 1.9s cubic-bezier(.55, 0, .25, 1) .25s forwards; }

/* ---------- hero ---------- */

.hero-text > * { animation: rise 1s cubic-bezier(.2, .7, .2, 1) both; }
.hero-text > :nth-child(1) { animation-delay: .05s; }
.hero-text > :nth-child(2) { animation-delay: .15s; }
.hero-text > :nth-child(3) { animation-delay: .35s; }
.hero-text > :nth-child(4) { animation-delay: .5s; }
.hero-photo img { animation: photo-in 1.8s ease .1s both; }
.hero-photo::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 30% 85% at 50% -8%, rgba(175, 205, 240, 0.11), rgba(175, 205, 240, 0.03) 55%, transparent 75%);
  mix-blend-mode: screen;
  animation: beam 9s ease-in-out infinite alternate;
}
.stars { position: absolute; z-index: 1; pointer-events: none; }

/* ---------- reveal ---------- */

.js [data-reveal]:not([data-reveal="words"]) {
  opacity: 0; transform: translateY(18px);
  transition: opacity .8s ease var(--d, 0ms), transform .9s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms);
}
.js [data-reveal="row"] { transform: translateX(-16px); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- work cards ---------- */

.card {
  position: relative;
  background:
    radial-gradient(420px circle at var(--mx, 50%) var(--my, -420px), rgba(63, 167, 209, 0.08), transparent 60%),
    var(--bg-raised);
}
.js .card[data-reveal] {
  transition: opacity .8s ease var(--d, 0ms), transform .9s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms), border-color .3s ease;
}
.card .motif { transition: color .4s ease; }
.card:hover, .card.is-live { border-color: var(--line-strong); }
.card:hover .motif, .card.is-live .motif { color: var(--muted); }

.js .card .draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s cubic-bezier(.6, 0, .2, 1) calc(var(--d, 0ms) + 250ms); }
.js .card.in .draw { stroke-dashoffset: 0; }

.motif .accent { stroke: var(--accent); }
.m-audio .idle, .m-audio .wave-g { transition: opacity .4s ease; }
.m-audio .wave-g { opacity: 0; }
.m-audio .wave { animation: flow 1.6s linear infinite paused; }
.m-audio .pulse { transform-box: fill-box; transform-origin: center; }
.card:hover .m-audio .idle, .card.is-live .m-audio .idle { opacity: 0; }
.card:hover .m-audio .wave-g, .card.is-live .m-audio .wave-g { opacity: 1; }
.card:hover .m-audio .wave, .card.is-live .m-audio .wave { animation-play-state: running; }
.card:hover .m-audio .pulse, .card.is-live .m-audio .pulse { animation: breathe-y .45s ease-in-out infinite alternate; }

.seq { transform-box: fill-box; transform-origin: 0 50%; }
.card:hover .seq, .card.is-live .seq { animation: seq1 3.4s cubic-bezier(.5, 0, .3, 1) infinite; }
.card:hover .s2, .card.is-live .s2 { animation-name: seq2; }
.card:hover .s3, .card.is-live .s3 { animation-name: seq3; }
.card:hover .s4, .card.is-live .s4 { animation-name: seq4; }
.card:hover .cursor, .card.is-live .cursor { animation: blink 1s steps(1) infinite; }

.status:not(.early)::before { animation: rec 2.6s ease-in-out infinite; }

/* ---------- background story ---------- */

.story-section { position: relative; overflow: hidden; }
.story-section > .wrap { position: relative; z-index: 1; }
.story-glow { position: absolute; inset: 0; pointer-events: none; }
.story-glow span {
  position: absolute; left: 62%; top: 42%;
  width: min(1100px, 150vw); aspect-ratio: 1.3; border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0; transition: opacity 1.4s ease;
}
.g-stage { background: radial-gradient(closest-side, rgba(214, 158, 84, 0.17), rgba(214, 158, 84, 0.05) 55%, transparent); }
.g-screen { background: radial-gradient(closest-side, rgba(63, 167, 209, 0.17), rgba(63, 167, 209, 0.05) 55%, transparent); }
.g-ai { background: radial-gradient(closest-side, rgba(146, 128, 255, 0.17), rgba(63, 200, 230, 0.07) 50%, transparent); }
.story-section[data-mood="stage"] .g-stage,
.story-section[data-mood="screen"] .g-screen,
.story-section[data-mood="ai"] .g-ai { opacity: 1; }
.story-section[data-mood="ai"] .g-ai { animation: heartbeat 1.6s ease-out, breathe 8s ease-in-out 1.6s infinite; }

.js .about-title .w {
  display: inline-block; opacity: 0; transform: translateY(.35em);
  transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--i) * 55ms);
}
.js .about-title.in .w { opacity: 1; transform: none; }

.js .story .ln { color: rgba(195, 203, 215, 0.28); transition: color .7s ease; }
.js .story .ln.lit { color: var(--text); }
.ai-word { font-style: normal; }
.story-section[data-mood="ai"] .ai-word {
  background: linear-gradient(90deg, #7fd3f0, #a99bff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.facts div { position: relative; }
.facts div::before {
  content: ""; position: absolute; left: -14px; top: 30%; width: 3px; height: 40%;
  border-radius: 2px; background: var(--accent);
  opacity: 0; transform-origin: 50% 100%; transition: opacity .2s ease;
}
.facts div:hover::before { opacity: 1; animation: meter .8s linear infinite alternate; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal]:not([data-reveal="words"]) { opacity: 1; transform: none; }
  .js .about-title .w { opacity: 1; transform: none; }
  .js .sig-write { -webkit-mask-image: none; mask-image: none; }
  .hero-photo img { opacity: .45; }
  .js .card .draw { stroke-dashoffset: 0; }
  .js .story .ln { color: inherit; }
  .hero-photo::before { display: none; }
}
