/* utkumese.com — editorial dark-first design, no framework. */

:root {
  --bg: #0b0d12;
  --bg-2: #11141b;
  --bg-3: #171b24;
  --fg: #ecebe6;
  --fg-2: #b5b3ac;
  --fg-3: #7d7b74;
  --line: rgba(236, 235, 230, 0.1);
  --accent: #5df2a0;        /* signal green: live things */
  --accent-ink: #05341c;
  --warm: #f2b45d;
  --sky: #6ec1ff;
  --mint: #5df2a0;
  --lime: #c6f25d;
  --orange: #ff8a5b;
  --blue: #8d9bff;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  --radius: 18px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1180px;
  --pad: clamp(16px, 5vw, 64px);
}

:root[data-theme="light"] {
  --bg: #f6f3ee;
  --bg-2: #fffdf9;
  --bg-3: #efebe4;
  --fg: #16181d;
  --fg-2: #4d5058;
  --fg-3: #80838b;
  --line: rgba(22, 24, 29, 0.1);
  --accent: #0f9d58;
  --accent-ink: #ffffff;
  --warm: #c9811a;
  --sky: #1f7fd1;
  --mint: #0f9d58;
  --lime: #6b8f00;
  --orange: #d9532a;
  --blue: #4b5bd6;
  --shadow: 0 30px 80px -40px rgba(22, 24, 29, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--font-sans);
  overflow-x: hidden;
}
body.term-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Subtle film grain to make the dark background feel physical */
.grain {
  pointer-events: none; position: fixed; inset: 0; z-index: 1; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-theme="light"] .grain { opacity: 0.08; }

.mono { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.01em; }
.small { font-size: 0.75rem; }
.muted { color: var(--fg-2); }
.center { text-align: center; }
kbd { font-family: var(--font-mono); font-size: 0.75em; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--bg-3); }

.display {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.02;
  font-size: clamp(2.2rem, 5.2vw, 4.4rem);
  text-wrap: balance;
}
.display em { font-style: italic; color: var(--fg-2); }
#hero-headline span, #hero-headline em { display: block; }
.display.small { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 20px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--accent); margin-bottom: 14px;
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--fg-2); max-width: 36em; margin-top: 22px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-weight: 600; font-size: .95rem; }
.brand-text .mono { font-size: .62rem; color: var(--fg-3); text-transform: uppercase; letter-spacing: .1em; }
.nav { display: flex; gap: 22px; margin-left: 10px; }
.nav a { color: var(--fg-2); font-size: 0.92rem; padding: 6px 0; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.nav a:hover { color: var(--fg); border-color: var(--accent); }
.controls { margin-left: auto; display: flex; gap: 8px; }
.chip {
  height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--fg-2);
  font-size: 0.8rem; display: inline-flex; align-items: center; gap: 6px;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
}
.chip:hover { border-color: var(--fg-3); color: var(--fg); transform: translateY(-1px); }
.chip.icon { width: 34px; padding: 0; justify-content: center; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: none; }
@media (max-width: 760px) { .nav { display: none; } .chip.mono span { display: none; } .brand-text .mono { display: none; } }

/* ---------- hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto; padding: clamp(56px, 9vw, 120px) var(--pad) 40px;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(32px, 6vw, 96px); align-items: center;
  position: relative; z-index: 2;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px;
  font-weight: 500; font-size: 0.95rem; border: 1px solid var(--line); color: var(--fg); background: var(--bg-2);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--fg-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.hint { margin-top: 26px; color: var(--fg-3); }

.hero-portrait { margin: 0; position: relative; justify-self: center; width: min(100%, 330px); }
.hero-portrait img { width: 100%; height: auto; border-radius: 28px; box-shadow: var(--shadow); position: relative; z-index: 1; }
.hero-portrait .ring {
  position: absolute; inset: -6%; border-radius: 36px; z-index: 0;
  background: conic-gradient(from 180deg, var(--accent), var(--sky), var(--warm), var(--accent));
  filter: blur(26px); opacity: 0.45; animation: spin 18s linear infinite;
}
.hero-portrait figcaption { text-align: center; margin-top: 16px; color: var(--fg-3); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-portrait { order: -1; width: min(62%, 250px); }
}

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; position: relative; z-index: 2; }
.marquee-track { display: flex; gap: 22px; width: max-content; animation: marquee 48s linear infinite; font-family: var(--font-mono); font-size: 0.8rem; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.12em; }
.marquee-track i { color: var(--accent); font-style: normal; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 9vw, 128px) var(--pad); position: relative; z-index: 2; }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head .muted { margin-top: 18px; font-size: 1.05rem; }
.section, .now, .card, .case, .fact, .pillar, .now-card { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.section.in, .now.in, .card.in, .case.in, .fact.in, .pillar.in, .now-card.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .section, .now, .card, .case, .fact, .pillar, .now-card { opacity: 1; transform: none; transition: none; }
  .preloader { display: none; }
  .marquee-track, .hero-portrait .ring { animation: none; }
}

/* project cards */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card {
  --tone: var(--accent);
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 24px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line);
  overflow: hidden; transition: transform 0.25s ease, border-color 0.25s, opacity 0.6s ease;
}
.card::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 3px; background: var(--tone); opacity: 0.9; }
.card::after { content: ""; position: absolute; width: 220px; height: 220px; right: -90px; top: -90px; border-radius: 50%; background: var(--tone); opacity: 0.08; filter: blur(30px); transition: opacity 0.3s; }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--tone) 40%, var(--line)); }
.card:hover::after { opacity: 0.18; }
.card header { display: flex; justify-content: space-between; color: var(--fg-3); }
.card h3 { font-family: var(--font-serif); font-size: 1.7rem; line-height: 1.1; letter-spacing: -0.01em; }
.card p { color: var(--fg-2); font-size: 0.95rem; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-family: var(--font-mono); font-size: 0.72rem; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-2); }
.card-links { display: flex; gap: 14px; font-size: 0.85rem; }
.card-links a { color: var(--tone); border-bottom: 1px solid transparent; }
.card-links a:hover { border-color: currentColor; }
.tone-mint { --tone: var(--mint); } .tone-sky { --tone: var(--sky); } .tone-warm { --tone: var(--warm); }
.tone-lime { --tone: var(--lime); } .tone-orange { --tone: var(--orange); } .tone-blue { --tone: var(--blue); }

.project-list { margin-top: 24px; border-top: 1px solid var(--line); }
.row { --tone: var(--accent); display: grid; grid-template-columns: 170px 1fr 260px; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.row-meta { display: flex; flex-direction: column; gap: 4px; color: var(--fg-3); }
.row-meta span:first-child { color: var(--tone); }
.row-main h3 { font-family: var(--font-serif); font-size: 1.35rem; margin-bottom: 6px; }
.row-main p { color: var(--fg-2); font-size: 0.93rem; }
.row-side { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.row-side .card-links { font-size: 0.82rem; }
@media (max-width: 860px) { .row { grid-template-columns: 1fr; gap: 10px; } .row-meta { flex-direction: row; gap: 14px; } }
#projects-toggle { margin-top: 28px; }

/* about */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: clamp(40px, 6vw, 72px); }
.fact { padding: 18px 20px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.fact span { color: var(--accent); }
.fact strong { font-weight: 500; font-size: 0.95rem; }
.two-col { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.tl-meta { color: var(--fg-3); display: flex; flex-direction: column; gap: 10px; }
.logo-tile { display: inline-flex; align-items: center; justify-content: center; width: 104px; height: 36px; border-radius: 8px; background: #fff; padding: 5px 8px; border: 1px solid var(--line); }
.logo-tile img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.timeline.edu { margin-bottom: 28px; }
.toolkit-eyebrow { margin-top: 8px; }
.timeline h4 { font-weight: 600; font-size: 1rem; }
.timeline strong { display: block; font-weight: 400; color: var(--fg-3); font-size: 0.85rem; margin: 2px 0 8px; }
.timeline p { color: var(--fg-2); font-size: 0.92rem; }
@media (max-width: 520px) { .timeline li { grid-template-columns: 1fr; gap: 8px; } .tl-meta { flex-direction: row; align-items: center; } }
.stack-group { padding: 18px 0; border-top: 1px solid var(--line); }
.stack-group h4 { font-weight: 500; font-size: 0.92rem; margin-bottom: 10px; color: var(--fg-2); }

/* contact */
.contact { text-align: center; }
.contact .muted { margin: 18px auto 0; max-width: 36em; }
.contact .cta-row { justify-content: center; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 32px var(--pad) 48px; max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; position: relative; z-index: 2; font-size: 0.9rem; }
.footer a { border-bottom: 1px solid var(--line); }
.footer a:hover { border-color: var(--accent); }

/* ---------- terminal ---------- */
.terminal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.term-window { width: min(860px, 100%); height: min(560px, 90vh); display: flex; flex-direction: column; background: #0c0f14; color: #d7e1d9; border-radius: 14px; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 40px 100px -20px rgba(0,0,0,0.9); overflow: hidden; animation: pop 0.18s ease-out; }
@keyframes pop { from { transform: translateY(10px) scale(0.985); opacity: 0; } }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #141821; border-bottom: 1px solid rgba(255,255,255,0.08); }
.term-bar .dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.term-title { margin-left: 10px; color: #8a94a0; }
.term-close { margin-left: auto; color: #8a94a0; font-size: 1.3rem; line-height: 1; }
.term-body { flex: 1; padding: 16px 18px; overflow-y: auto; font-size: 0.85rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.term-body .cmd { color: #5df2a0; }
.term-body .err { color: #ff8a5b; }
.term-input { display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-top: 1px solid rgba(255,255,255,0.08); }
.term-input .prompt { color: #5df2a0; white-space: nowrap; }
.term-input .prompt span { color: #6ec1ff; }
.term-input input { flex: 1; background: none; border: 0; outline: 0; color: #d7e1d9; font: inherit; caret-color: #5df2a0; }
@media (max-width: 520px) { .term-input .prompt { display: none; } }

/* ---------- 404 ---------- */
.nf { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: var(--pad); position: relative; z-index: 2; }
.nf .code { font-family: var(--font-mono); color: var(--accent); margin-bottom: 14px; }
.nf-lead { margin: 20px auto 30px; }

/* ---------- now ---------- */
.now { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) clamp(40px, 6vw, 72px); position: relative; z-index: 2; }
.now-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.now-card { padding: 20px 22px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; transition: border-color .25s, transform .25s, opacity .6s, box-shadow .25s; }
.now-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-2px); }
.now-k { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; }
.now-card h3 { font-family: var(--font-serif); font-size: 1.45rem; line-height: 1.1; }
.now-card p { color: var(--fg-2); font-size: .92rem; }

/* ---------- case studies ---------- */
.cases { display: flex; flex-direction: column; gap: 14px; }
.case { --tone: var(--accent); position: relative; padding: clamp(20px, 3vw, 32px); border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; transition: border-color .25s, opacity .6s ease, transform .6s ease; }
.case::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone); }
.case::after { content: ""; position: absolute; width: 320px; height: 320px; right: -140px; top: -160px; border-radius: 50%; background: var(--tone); opacity: .07; filter: blur(40px); pointer-events: none; }
.case.open, .case:hover { border-color: color-mix(in srgb, var(--tone) 35%, var(--line)); }
.case-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: start; }
.case-no { color: var(--tone); font-size: .85rem; padding-top: 8px; }
.case h3 { font-family: var(--font-serif); font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.05; letter-spacing: -.01em; }
.case-kicker { color: var(--fg-3); margin-top: 6px; }
.case-toggle { white-space: nowrap; }
.case-summary { margin: 16px 0 0 calc(0.85rem + 18px + 14px); color: var(--fg-2); font-size: 1.02rem; max-width: 62em; }
.case-body { margin: 22px 0 0 calc(0.85rem + 18px + 14px); padding-top: 22px; border-top: 1px solid var(--line); animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.case-cols { display: grid; grid-template-columns: minmax(220px, .8fr) 1.4fr; gap: 28px; }
.case-body h4 { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--tone); margin: 0 0 8px; }
.case-body h4 + .tags, .case-body p { margin-bottom: 18px; }
.case-body p { color: var(--fg-2); font-size: .95rem; }
.highlights { display: flex; flex-direction: column; gap: 10px; }
.highlights li { position: relative; padding-left: 18px; color: var(--fg-2); font-size: .95rem; }
.highlights li::before { content: "▸"; position: absolute; left: 0; color: var(--tone); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 22px; }
.gallery img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-3); }
.case .card-links { margin: 18px 0 0 calc(0.85rem + 18px + 14px); }
@media (max-width: 760px) {
  .case-head { grid-template-columns: 1fr auto; }
  .case-no { display: none; }
  .case-summary, .case-body, .case .card-links { margin-left: 0; }
  .case-cols { grid-template-columns: 1fr; }
}
#projects-others { margin-top: 28px; }

/* ---------- pillars ---------- */
.pillars-section { padding-top: 0; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.pillar { padding: 22px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; transition: opacity .6s ease, transform .6s ease; }
.pillar-no { color: var(--accent); font-size: .75rem; }
.pillar h3 { font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.15; }
.pillar p { color: var(--fg-2); font-size: .92rem; }

/* ---------- toolkit emphasis ---------- */
.small-note { font-size: .85rem; margin: -8px 0 16px; }
.tags li.primary { color: var(--fg); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, transparent); }

.writing { margin-top: clamp(36px, 5vw, 56px); }
.writing-list li { border-top: 1px solid var(--line); }
.writing-list li:last-child { border-bottom: 1px solid var(--line); }
.writing-list a { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.writing-list a:hover span:first-child { color: var(--accent); }

/* ---------- preloader ---------- */
.preloader { position: fixed; inset: 0; z-index: 100; background: #0b0d12; display: grid; place-items: center; transition: opacity .5s ease, visibility .5s; }
.preloader img { width: 96px; height: 96px; border-radius: 22px; animation: pre-in .9s ease both; }
.preloader.done { opacity: 0; visibility: hidden; }
@keyframes pre-in { 0% { opacity: 0; transform: scale(.82); } 60% { opacity: 1; transform: scale(1.04); } 100% { transform: scale(1); } }
