/* ============================================================
   emreyakut.com — PROFESSIONAL MODE  ·  "What I've built."
   A long-form, editorial engineering story. Chapters, not
   sections. Warm paper reading plates alternating with dark
   blueprint plates — a journey, handcrafted, cinematic.
   Identity: engineering monograph. Serif display (Fraunces),
   mono technical notes, a single rust accent. Self-contained.
   ============================================================ */

/* ---- mode visibility (one page, two perspectives) ---- */
html:has(body.mode-pro), body.mode-pro { background: #f4f0e8 !important; }
body.mode-pro .topnav, body.mode-pro main, body.mode-pro #atmos, body.mode-pro #linkfx, body.mode-pro #spine { display: none !important; }
body.mode-mind #proMode, body.mode-mind .pro-nav { display: none; }
#proMode { display: block; position: relative; z-index: 10; }

/* cinematic dissolve between layers */
#modeFade { position: fixed; inset: 0; z-index: 9999; background: #06080d; opacity: 0; pointer-events: none; transition: opacity .42s ease; }
#modeFade.on { opacity: 1; pointer-events: all; }
#modeFade .mf-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; opacity: 0; transform: translateY(8px); transition: opacity .34s .12s, transform .34s .12s; }
#modeFade.on .mf-in { opacity: 1; transform: none; }
#modeFade .mf-eye { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: #e0673c; }
#modeFade .mf-slogan { font-family: 'Fraunces', serif; font-size: clamp(30px, 5.5vw, 58px); font-weight: 600; letter-spacing: -.01em; color: #fff; }
.mode-enter { animation: modeEnter .62s cubic-bezier(.2, .8, .2, 1); }
@keyframes modeEnter { from { opacity: 0; } to { opacity: 1; } }

/* language switch — the content shakes, topples and dissolves, then re-resolves in the new language */
.lang-anim { animation: langTopple .84s cubic-bezier(.6, 0, .3, 1) both; transform-origin: 50% 62%; will-change: transform, filter, opacity; }
@keyframes langTopple {
  0% { transform: none; filter: blur(0); opacity: 1; }
  8% { transform: translateX(-8px) rotate(-.5deg); }
  17% { transform: translateX(7px) rotate(.5deg); }
  26% { transform: translateX(-4px) rotate(-.3deg); }
  46% { transform: perspective(1100px) rotateX(17deg) translateY(28px) scale(.96); filter: blur(10px); opacity: 0; }
  56% { transform: perspective(1100px) rotateX(17deg) translateY(28px) scale(.96); filter: blur(12px); opacity: 0; }
  72% { transform: perspective(1100px) rotateX(-8deg) translateY(-14px) scale(.992); filter: blur(5px); opacity: 0; }
  100% { transform: none; filter: blur(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .lang-anim { animation: none; } }

/* ============================================================
   EDITORIAL SYSTEM
   ============================================================ */
#proMode {
  --paper: #f4f0e8; --paper2: #ece6d9; --ink: #18130d; --ink2: #4c463c; --mut: #8d8475; --line: #ddd4c3; --line2: #cabfa8;
  --acc: #bb4a28; --acc-ink: #9c3c20; --acc-soft: #f2e2d6;
  --blue: #20405a;
  background: var(--paper); color: var(--ink);
  font-size: 18px; line-height: 1.72; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
/* leak-proof type */
#proMode, #proMode p, #proMode div, #proMode span, #proMode a, #proMode li, #proMode ul, #proMode button, #proMode img, #proMode header, #proMode footer, #proMode nav, #proMode section, #proMode figure { font-family: 'Inter', system-ui, -apple-system, sans-serif; box-sizing: border-box; }
#proMode h1, #proMode h2, #proMode h3, #proMode .ch-title, #proMode .pro-name, #proMode .pro-quote, #proMode .principle, #proMode .ch-lead em, #proMode .final-line { font-family: 'Fraunces', Georgia, serif; }
#proMode .mono, #proMode .ch-num, #proMode .ch-kicker, #proMode .anno, #proMode .pro-role, #proMode .eco-tag, #proMode .tl-year { font-family: 'JetBrains Mono', monospace; }
#proMode ::selection { background: var(--acc-soft); }
#proMode a { color: inherit; text-decoration: none; }
.pro-wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(22px, 5vw, 60px); }
.pro-col { max-width: 680px; }

/* dark blueprint plates */
.chapter.dark, .pro-hero, .pro-final {
  --paper: #0f141b; --paper2: #141c26; --ink: #efeade; --ink2: #b3ac9d; --mut: #7c8794; --line: rgba(239, 234, 222, .12); --line2: rgba(239, 234, 222, .2);
  --acc: #e0673c; --acc-ink: #e0673c; --acc-soft: rgba(224, 103, 60, .14);
  background: #0f141b; color: var(--ink);
}
.chapter.dark, .pro-final { position: relative; }
.chapter.dark::before, .pro-hero::before, .pro-final::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(120, 150, 180, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 150, 180, .05) 1px, transparent 1px);
  background-size: 34px 34px;
}

/* ---- adaptive nav ---- */
.pro-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 clamp(22px, 5vw, 60px); transition: background .3s, border-color .3s, color .3s; color: #efeade; border-bottom: 1px solid transparent; }
.pro-nav.solid { background: rgba(244, 240, 232, .86); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-bottom-color: #ddd4c3; color: #18130d; }
.pro-brand { font-family: 'Fraunces', serif; font-weight: 600; font-size: 18px; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; color: inherit; }
.pro-brand .mk { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; background: var(--acc, #bb4a28); color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; }
.pro-nav.solid .pro-brand .mk { background: #bb4a28; }
.pro-nav .sp { flex: 1; }
.pro-navlinks { display: flex; gap: 24px; }
.pro-navlinks a { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .04em; opacity: .72; transition: opacity .15s; }
.pro-navlinks a:hover { opacity: 1; }
@media (max-width: 1180px) { .pro-navlinks { display: none; } }
.pro-nav .mode-seg, .pro-nav .pro-lang { flex: none; }
.pro-lang { border: 1px solid currentColor; background: none; border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; color: inherit; padding: 6px 10px; cursor: pointer; opacity: .8; }
.pro-lang:hover { opacity: 1; }
.mode-seg { display: inline-flex; border: 1px solid currentColor; border-radius: 999px; padding: 3px; opacity: .9; }
.mode-seg button { border: none; background: none; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 600; color: inherit; opacity: .6; padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: .18s; white-space: nowrap; }
.mode-seg button.on { background: currentColor; opacity: 1; }
.pro-nav .mode-seg button.on { color: var(--acc, #bb4a28); }
/* keep readable: invert the label color on the filled chip */
.mode-seg button.on { position: relative; }
.mode-seg button.on { color: #0f141b; background: #efeade; }
.pro-nav.solid .mode-seg button.on { background: #18130d; color: #f4f0e8; }
.topnav .mode-seg { border-color: var(--v2-line2, rgba(255, 255, 255, .14)); }
.topnav .mode-seg button { color: var(--text-mute, #8b95a3); }
.topnav .mode-seg button.on { background: var(--accent, #2fe0a8); color: #04140e; }

/* ---- HERO ---- */
.pro-hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 110px 0 70px; overflow: hidden; }
#proHeroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .55; }
.pro-hero .pro-wrap { position: relative; z-index: 2; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(30px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .pro-hero .pro-wrap { grid-template-columns: 1fr; } .pro-hero-portrait { order: -1; max-width: 240px; } }
.pro-role { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--acc); margin-bottom: 26px; }
.pro-role span { position: relative; }
.pro-role span + span::before { content: "·"; position: absolute; left: -11px; color: var(--mut); }
.pro-name { font-size: clamp(52px, 9vw, 116px); line-height: .92; letter-spacing: -.03em; font-weight: 600; margin: 0 0 28px; }
.pro-quote { font-size: clamp(21px, 2.7vw, 30px); line-height: 1.34; letter-spacing: -.01em; font-weight: 400; font-style: italic; color: var(--ink); margin: 0 0 30px; max-width: 24ch; }
.pro-quote b { font-style: normal; font-weight: 600; color: var(--acc); }
.pro-cta { display: flex; flex-wrap: wrap; gap: 13px; }
.pro-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--acc); background: var(--acc); color: #fff; border-radius: 2px; padding: 13px 22px; font-size: 14px; font-weight: 600; letter-spacing: .01em; cursor: pointer; transition: .18s; }
.pro-btn:hover { background: var(--acc-ink); border-color: var(--acc-ink); }
.pro-btn.ghost { background: none; color: var(--ink); border-color: var(--line2); }
.pro-btn.ghost:hover { border-color: var(--ink); background: rgba(239, 234, 222, .06); }
/* hero note */
.pro-hero-note { font-size: 16px; line-height: 1.7; color: var(--ink2); margin: 0 0 30px; max-width: 46ch; }
/* on the dark hero, the primary CTA is a high-contrast solid light fill; the secondary stays a quiet ghost */
#proMode .pro-hero .pro-cta .pro-btn:not(.ghost) { background: #f4f0e8 !important; color: #15110b !important; border-color: #f4f0e8 !important; font-weight: 700; opacity: 1 !important; box-shadow: 0 14px 34px -16px rgba(0, 0, 0, .7); }
#proMode .pro-hero .pro-cta .pro-btn:not(.ghost):hover { background: #ffffff !important; border-color: #ffffff !important; transform: translateY(-1px); }
#proMode .pro-hero .pro-cta .pro-btn.ghost { background: none !important; color: #efeade !important; border-color: rgba(239, 234, 222, .42) !important; }
#proMode .pro-hero .pro-cta .pro-btn.ghost:hover { border-color: #efeade !important; background: rgba(239, 234, 222, .06) !important; transform: translateY(-1px); }
/* hero secondary — a quiet text link, never a watermark; primary always leads */
.pro-cta-mind { background: none; border: 0; cursor: pointer; margin-left: 24px; font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .04em; color: #b3ac9d; opacity: .68; padding: 6px 2px; transition: opacity .25s, color .25s; }
.pro-cta-mind::after { content: " \2192"; }
.pro-cta-mind:hover { opacity: 1; color: #efeade; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 560px) { .pro-cta-mind { display: block; margin: 14px 0 0; } }

/* left chapter index — Professional only, adaptive over dark/paper plates */
.pro-rail { position: fixed; left: 26px; top: 50%; transform: translateY(-50%); z-index: 55; display: flex; flex-direction: column; gap: 13px; }
.pro-rail a { display: flex; align-items: center; gap: 10px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #6f6757; text-decoration: none; opacity: .6; transition: opacity .3s, color .3s; }
.pro-rail a::before { content: ""; width: 14px; height: 1px; background: currentColor; transition: width .3s; }
.pro-rail a.on::before { width: 30px; }
.pro-rail.on-dark a { color: #b3ac9d; }
/* hover + active ALWAYS the rust accent, regardless of chapter background */
.pro-rail a:hover, .pro-rail a.on,
.pro-rail.on-dark a:hover, .pro-rail.on-dark a.on { color: #e0673c; opacity: 1; }
@media (max-width: 1180px) { .pro-rail { display: none; } }
body.mode-mind .pro-rail { display: none; }

/* recent thinking — engineering notebook */
.notes { display: flex; flex-direction: column; gap: clamp(22px, 3.4vw, 40px); max-width: 900px; margin-top: 6px; }
.note { font-family: 'Fraunces', Georgia, serif; font-size: clamp(21px, 3.3vw, 37px); line-height: 1.24; letter-spacing: -.015em; font-weight: 400; color: var(--ink); margin: 0; padding-left: 26px; border-left: 2px solid var(--acc); }
.pro-hero-portrait { position: relative; }
.pro-hero-portrait img { width: 100%; max-width: 360px; aspect-ratio: 4/5; object-fit: cover; object-position: center top; border-radius: 3px; filter: grayscale(.86) contrast(1.07) brightness(.94) saturate(.74); box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .9), inset 0 0 78px 20px rgba(8, 11, 17, .52); }
.pro-hero-portrait::before { content: ""; position: absolute; left: -14px; top: -14px; width: 70px; height: 70px; border-left: 1px solid var(--acc); border-top: 1px solid var(--acc); }
.pro-hero-portrait::after { content: ""; position: absolute; right: -14px; bottom: -14px; width: 70px; height: 70px; border-right: 1px solid var(--acc); border-bottom: 1px solid var(--acc); }
.pro-scrollcue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--mut); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pro-scrollcue i { width: 1px; height: 30px; background: linear-gradient(var(--acc), transparent); animation: cuePulse 2s ease-in-out infinite; }
@keyframes cuePulse { 0%, 100% { opacity: .3; transform: scaleY(.6); } 50% { opacity: 1; transform: scaleY(1); } }

/* ---- CHAPTER frame ---- */
.chapter { padding: clamp(72px, 11vw, 150px) 0; position: relative; }
.ch-head { position: relative; z-index: 2; margin-bottom: clamp(32px, 5vw, 56px); }
.ch-kicker { display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--acc); margin-bottom: 20px; }
.ch-kicker::before { content: ""; width: 26px; height: 1px; background: var(--acc); }
.ch-num { position: absolute; right: 0; top: -10px; font-size: clamp(54px, 9vw, 120px); font-weight: 700; line-height: 1; color: var(--line); z-index: 0; letter-spacing: -.04em; }
.ch-title { font-size: clamp(34px, 5.4vw, 66px); line-height: 1.02; letter-spacing: -.025em; font-weight: 600; margin: 0; max-width: 16ch; }
.ch-lead { font-size: clamp(20px, 2.5vw, 26px); line-height: 1.5; color: var(--ink); font-weight: 400; margin: 28px 0 0; max-width: 30ch; }
.ch-lead em { font-style: italic; color: var(--acc); }
.chapter .pro-wrap > p, .ch-body p { position: relative; z-index: 2; font-size: 18.5px; line-height: 1.8; color: var(--ink2); margin: 0 0 22px; max-width: 680px; }
.ch-body p b, .chapter p b { color: var(--ink); font-weight: 600; }
.anno { position: relative; z-index: 2; display: inline-block; font-size: 12px; letter-spacing: .03em; color: var(--mut); border-left: 2px solid var(--acc); padding-left: 12px; margin: 4px 0 26px; }
.ch-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 820px) { .ch-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---- CH01 timeline ---- */
.tl { position: relative; z-index: 2; margin-top: 10px; border-left: 1px solid var(--line2); padding-left: 28px; }
.tl-item { position: relative; padding: 0 0 36px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -34px; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2px solid var(--acc); }
.tl-year { font-size: 12.5px; letter-spacing: .05em; color: var(--acc); margin-bottom: 7px; }
.tl-item h4 { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600; margin: 0 0 7px; letter-spacing: -.01em; }
.tl-item p { font-size: 16px; color: var(--ink2); margin: 0; line-height: 1.6; max-width: 52ch; }

/* current employer mark (white bg in the svg is dropped via multiply on the paper) */
.pro-cred { display: flex; align-items: center; gap: 16px; margin-top: 34px; }
.pro-cred .lab { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--mut); }
.pro-cred img { height: 46px; width: auto; }

/* ---- CH03 systems ecosystem ---- */
.eco { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 8px; }
@media (max-width: 820px) { .eco { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .eco { grid-template-columns: 1fr; } }
.eco-item { border: 1px solid var(--line); border-radius: 4px; padding: 20px; background: var(--paper2); transition: .2s; }
.eco-item:hover { border-color: var(--acc); transform: translateY(-3px); background: var(--paper); }
.eco-tag { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--acc); margin-bottom: 9px; }
.eco-item h4 { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 600; margin: 0 0 7px; }
.eco-item p { font-size: 14px; line-height: 1.55; color: var(--mut); margin: 0; }

/* ---- CH04 invisible layers (assembles on scroll) ---- */
.layers { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.layer { display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 4px; padding: 16px 20px; background: rgba(20, 28, 38, .4); opacity: 0; transform: translateX(-22px); transition: opacity .6s, transform .6s; }
.layer.in { opacity: 1; transform: none; }
.layer .lx { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--acc); width: 34px; flex: none; }
.layer b { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; color: var(--ink); }
.layer span { font-size: 14px; color: var(--mut); margin-left: auto; text-align: right; }
@media (max-width: 600px) { .layer span { display: none; } }

/* ---- CH07 principles ---- */
.principles { position: relative; z-index: 2; }
.principle { font-size: clamp(28px, 5vw, 58px); line-height: 1.12; letter-spacing: -.02em; font-weight: 500; color: var(--ink2); margin: 0; padding: clamp(26px, 4vw, 46px) 0; border-top: 1px solid var(--line); transition: color .4s, opacity .4s; opacity: .35; }
.principle:first-child { border-top: none; }
.principle.lit { color: var(--ink); opacity: 1; }
.principle b { color: var(--acc); font-weight: 500; }

/* ---- CH08 focus ---- */
.focus { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.focus span { border: 1px solid var(--line2); border-radius: 999px; padding: 11px 20px; font-size: 15px; color: var(--ink); transition: .18s; }
.focus span:hover { border-color: var(--acc); color: var(--acc); transform: translateY(-2px); }

/* ---- FINAL ---- */
.pro-final { padding: clamp(90px, 14vw, 200px) 0; text-align: center; }
.final-eye { position: relative; z-index: 2; font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--acc); margin-bottom: 26px; }
.final-line { position: relative; z-index: 2; font-size: clamp(30px, 5.2vw, 64px); line-height: 1.16; letter-spacing: -.02em; font-weight: 500; margin: 0 auto 14px; max-width: 18ch; }
.final-line .q { color: var(--acc); }
.final-sub { position: relative; z-index: 2; font-size: 19px; color: var(--ink2); max-width: 50ch; margin: 0 auto 38px; line-height: 1.6; }
.pro-links { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.pro-links a { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line2); border-radius: 2px; padding: 13px 20px; color: var(--ink); font-size: 14.5px; font-weight: 600; transition: .18s; }
.pro-links a:hover { border-color: var(--acc); color: var(--acc); }
.pro-copy { position: relative; z-index: 2; margin-top: 56px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--mut); }

/* ---- motion utilities ---- */
#proMode .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.2, .8, .2, 1), transform .8s cubic-bezier(.2, .8, .2, 1); }
#proMode .reveal.in { opacity: 1; transform: none; }
#proMode .pro-hero .reveal { opacity: 1; transform: none; }
#proMode .parallax { will-change: transform; }
@media (prefers-reduced-motion: reduce) { #proMode .reveal, .layer { transition: none; opacity: 1 !important; transform: none !important; } }
