/* ===========================================================
   Ozan Tahta — portfolio
   Graphite ground, sodium accent, industrial sans over mono.
   =========================================================== */

:root {
  --ink: #0D0F12;
  --surface: #14171C;
  --surface-hi: #171B22;
  --line: #1C2027;
  --border: #242830;
  --border-2: #2E333C;
  --border-3: #3A3F48;
  --text: #F2F1EC;
  --text-2: #C9CDD3;
  --muted: #9CA3AC;
  --faint: #7C838D;
  --accent: #E9A23B;
  --accent-hi: #F5C87A;

  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: Archivo, var(--sans);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(20px, 5vw, 40px);
  --section-y: clamp(56px, 9vw, 88px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hi); }

h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; line-height: 1.1; }

img, svg { display: block; max-width: 100%; }

::selection { background: var(--accent); color: var(--ink); }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--ink); padding: 12px 18px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { left: 12px; top: 12px; }

.container { max-width: 1240px; margin: 0 auto; padding-inline: var(--gutter); }

.section { border-bottom: 1px solid var(--line); padding-block: var(--section-y); }

.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  color: var(--accent); text-transform: uppercase;
}

.h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; }

.rule { display: block; height: 2px; width: 64px; background: var(--accent); transform-origin: left; }

.lede { font-size: clamp(16px, 1.6vw, 18px); line-height: 1.65; color: var(--text-2); margin: 0; }

.body-text { font-size: clamp(15px, 1.5vw, 17px); line-height: 1.68; color: var(--text-2); margin: 0; }

.small { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0; }

.stack-line { font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(13, 15, 18, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner { display: flex; align-items: center; gap: 16px; padding-block: 14px; }

.brand {
  font-family: var(--display); font-weight: 700; font-size: 17px;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em;
}
.brand span { color: var(--accent); }
.brand:hover { color: var(--text); }

.nav-links { display: flex; align-items: center; gap: 26px; margin-left: auto; }

.nav-link {
  position: relative; font-size: 14px; color: var(--text-2);
  text-decoration: none; transition: color 0.25s;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -5px; width: 100%; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav-link:hover, .nav-link[aria-current="true"] { color: var(--text); }
.nav-link:hover::after, .nav-link[aria-current="true"]::after { transform: scaleX(1); transform-origin: left; }

.nav-toggle {
  display: none; width: 44px; height: 44px; margin-left: auto;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border-2); border-radius: 3px;
  cursor: pointer; color: var(--text);
}
.nav-toggle svg { transition: transform 0.3s var(--ease); }
.nav-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }

.nav-drawer { display: none; }

/* ---------- buttons & tags ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 3px;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s, border-color 0.25s, color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--ink); border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: var(--ink); }
.btn-ghost { border: 1px solid var(--border-3); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--muted); color: var(--text); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 14px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.tag {
  display: inline-flex; align-items: center; height: 34px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface);
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
  transition: border-color 0.3s, color 0.3s, transform 0.3s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 9px; }

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

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }

.grid-bg {
  position: absolute; inset: -40px; pointer-events: none; opacity: 0.75;
  background-image:
    linear-gradient(#1A1E25 1px, transparent 1px),
    linear-gradient(90deg, #1A1E25 1px, transparent 1px);
  background-size: 80px 80px;
  animation: gridDrift 22s linear infinite;
}

.cross-v, .cross-h {
  position: absolute; background: var(--accent); opacity: 0;
  transition: opacity 0.3s; pointer-events: none; z-index: 2;
}
.cross-v { top: 0; bottom: 0; width: 1px; }
.cross-h { left: 0; right: 0; height: 1px; }
.readout {
  position: absolute; z-index: 2; pointer-events: none; opacity: 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--accent); transition: opacity 0.3s;
}
.hero.is-tracking .cross-v, .hero.is-tracking .cross-h { opacity: 0.45; }
.hero.is-tracking .readout { opacity: 1; }

.hero-inner {
  position: relative; display: flex; flex-wrap: wrap; gap: 48px;
  padding-block: clamp(56px, 9vw, 96px) clamp(48px, 8vw, 80px);
}

.hero-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.hero-side { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 20px; align-self: flex-end; }

.status {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: pulseDot 2.4s ease-out infinite; flex-shrink: 0;
}

.hero h1 {
  font-size: clamp(38px, 6.4vw, 72px); font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.02;
}
.hero h1 .word { display: inline-block; animation: rise 1s var(--ease) both; }
.hero h1 .dot { color: var(--accent); }

.meter { display: flex; align-items: flex-end; gap: 5px; height: 76px; }
.meter span {
  flex: 1 1 0; height: 100%; background: var(--border);
  transform-origin: bottom; animation: bar 2.6s ease-in-out infinite;
}
.meter span:nth-child(3), .meter span:nth-child(6) { background: var(--accent); }
.meter span:nth-child(2), .meter span:nth-child(4), .meter span:nth-child(5) { background: var(--border-2); }

.portrait { position: relative; margin: 0; width: 100%; max-width: 380px; align-self: flex-end; animation: rise 1s var(--ease) .8s both; }
.portrait::before, .portrait::after { content: ""; position: absolute; width: 34px; height: 34px; border: 0 solid var(--accent); pointer-events: none; }
.portrait::before { top: -10px; left: -10px; border-top-width: 2px; border-left-width: 2px; }
.portrait::after { bottom: -10px; right: -10px; border-bottom-width: 2px; border-right-width: 2px; }
.portrait-frame { position: relative; overflow: hidden; border-radius: 3px; border: 1px solid var(--border); background: var(--surface); aspect-ratio: 17 / 18; }
.portrait-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.portrait-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,15,18,0) 62%, rgba(13,15,18,.82) 100%); }
.portrait figcaption { position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.portrait figcaption b { font-family: var(--display); font-weight: 600; font-size: 15px; }
.portrait figcaption span { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.stats { display: flex; gap: 10px; width: 100%; max-width: 380px; align-self: flex-end; }
.stats .stat { flex: 1 1 0; min-width: 0; padding-left: 10px; }
.stats .stat b { font-size: clamp(22px, 1.9vw, 26px); white-space: nowrap; }
.stats .stat span { font-size: 12px; line-height: 1.4; padding-top: 4px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding-left: 18px; border-left: 2px solid var(--border); }
.stats .stat:first-child { border-left-color: var(--accent); }
.stat b { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 3.4vw, 40px); line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }

/* ---------- ticker ---------- */

.ticker { border-bottom: 1px solid var(--line); overflow: hidden; padding-block: 16px; }
.ticker-track {
  display: flex; width: max-content; gap: 40px; white-space: nowrap;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; color: #5F6671;
  animation: marquee 34s linear infinite;
}
.ticker-track i { color: var(--accent); font-style: normal; }

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

.split { display: flex; flex-wrap: wrap; gap: 48px; }
.split-aside { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.split-body { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }

.facts {
  margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px; padding-top: 10px; border-top: 1px solid var(--border);
}
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--muted); padding-bottom: 5px; }
.facts dd { margin: 0; font-size: 15px; }

/* ---------- skills ---------- */

.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }
.section-head.row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.section-head.row > div { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.section-head.row > p { flex: 1 1 260px; min-width: 0; }

.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.tab {
  min-height: 44px; padding: 0 20px; border-radius: 3px; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: 14px;
  background: transparent; color: var(--text-2); border: 1px solid var(--border-2);
  transition: transform 0.25s var(--ease), background-color 0.25s, border-color 0.25s, color 0.25s;
}
.tab:hover { transform: translateY(-2px); }
.tab[aria-selected="true"] { background: var(--accent); color: var(--ink); border-color: var(--accent); }

.panel {
  position: relative; display: flex; flex-wrap: wrap; gap: 32px;
  padding: clamp(22px, 3vw, 32px); border-radius: 4px;
  background: var(--surface); border: 1px solid var(--border); overflow: hidden;
}
.panel > p { flex: 1 1 280px; min-width: 0; font-size: 16px; line-height: 1.62; color: var(--text-2); margin: 0; }
.panel > ul { flex: 999 1 420px; min-width: 0; align-content: flex-start; }
.panel[hidden] { display: none; }

.scan {
  position: absolute; left: 0; top: 0; width: 100%; height: 56px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(233,162,59,0), rgba(233,162,59,0.07), rgba(233,162,59,0));
  animation: scan 5s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

/* ---------- experience ---------- */

.roles { display: flex; flex-direction: column; gap: 30px; }
.role { display: flex; flex-wrap: wrap; gap: 20px 40px; padding-top: 26px; border-top: 1px solid var(--border); }
.role-meta { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.role-when { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.role-where { font-size: 14px; color: var(--muted); }
.role-body { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.role-body h3 { font-size: clamp(19px, 2.2vw, 22px); font-weight: 600; }

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

.card {
  display: flex; flex-direction: column; gap: 13px;
  padding: clamp(20px, 2.6vw, 28px); border-radius: 4px;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.4s var(--ease), border-color 0.4s, background-color 0.4s;
}
a.card { text-decoration: none; color: inherit; }
.card:hover { transform: translateY(-7px); border-color: #4C535E; background: var(--surface-hi); }
.card h3 { font-size: clamp(18px, 2vw, 21px); font-weight: 600; }
.card p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.card-cta { font-size: 14px; font-weight: 600; color: var(--accent); }

.thumb {
  position: relative; height: 150px; border-radius: 3px;
  background: var(--ink); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.thumb svg { width: 88%; height: 104px; }
.thumb .scan { height: 40px; }

.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* ---------- certifications ---------- */

.cert-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cert-head h3 { font-size: 19px; font-weight: 600; }
.cert-year { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.cert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.cert-list li { font-size: 14px; line-height: 1.5; color: var(--text-2); }
.cert-link {
  color: var(--text-2); text-decoration: none;
  border-bottom: 1px solid var(--border-2);
  transition: color 0.25s, border-color 0.25s;
}
.cert-link:hover { color: var(--accent); border-color: var(--accent); }
.cert-id { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* ---------- education ---------- */

.edu-item { display: flex; flex-wrap: wrap; gap: 8px 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.edu-item:last-of-type { border-bottom: 0; padding-bottom: 0; }
.edu-item > div { flex: 999 1 320px; min-width: 0; }
.edu-item h3 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.edu-when { font-family: var(--mono); font-size: 13px; color: var(--accent); white-space: nowrap; }

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

.contact { position: relative; overflow: hidden; }
.contact .grid-bg { opacity: 1; background-image: linear-gradient(#171B21 1px, transparent 1px), linear-gradient(90deg, #171B21 1px, transparent 1px); }
.contact-inner { position: relative; display: flex; flex-direction: column; gap: 28px; padding-block: clamp(64px, 10vw, 96px); }
.contact h2 { max-width: 820px; font-size: clamp(30px, 5vw, 56px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; }

.footer {
  margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 12px; color: var(--faint);
}

/* ---------- article (project page) ---------- */

.article { max-width: 880px; margin: 0 auto; padding-inline: var(--gutter); padding-block: clamp(40px, 7vw, 56px) clamp(56px, 9vw, 88px); display: flex; flex-direction: column; gap: 44px; }
.article section { display: flex; flex-direction: column; gap: 16px; }
.article h2 { font-size: clamp(22px, 3vw, 26px); font-weight: 700; }

.figure {
  position: relative; height: clamp(220px, 32vw, 400px); border-radius: 4px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.figure .scan { height: 66px; }
.figure svg { width: 72%; opacity: 0.85; }

.mini { padding: 18px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.mini svg { width: 100%; height: 84px; }
.mini span { font-family: var(--mono); font-size: 12px; color: var(--text-2); }

.step { padding: 22px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.step b { font-family: var(--mono); font-size: 11px; color: var(--accent); font-weight: 500; }
.step h3 { font-size: 17px; font-weight: 600; }
.step p { margin: 0; font-size: 14px; line-height: 1.58; color: var(--muted); }

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

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[style*="--d"] { transition-delay: var(--d); }

.rule-in { transform: scaleX(0); transition: transform 0.9s var(--ease); }
.rule-in.is-in { transform: scaleX(1); }

/* ---------- keyframes ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes gridDrift { from { background-position: 0 0; } to { background-position: 80px 80px; } }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 rgba(233,162,59,0.5); } 70% { box-shadow: 0 0 0 11px rgba(233,162,59,0); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes scan { 0% { transform: translateY(-120%); } 100% { transform: translateY(520%); } }
@keyframes bar { 0%, 100% { transform: scaleY(0.28); } 50% { transform: scaleY(1); } }
@keyframes trace { from { stroke-dashoffset: 520; } to { stroke-dashoffset: 0; } }

.trace { stroke-dasharray: 520; animation: trace 3.4s cubic-bezier(0.4, 0, 0.2, 1) infinite; }

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-drawer { display: block; border-top: 1px solid var(--line); }
  .nav-drawer[hidden] { display: none; }
  .nav-drawer ul { list-style: none; margin: 0; padding: 4px var(--gutter) 14px; display: flex; flex-direction: column; }
  .nav-drawer a {
    min-height: 48px; display: flex; align-items: center;
    font-size: 16px; color: var(--text-2); text-decoration: none;
    border-bottom: 1px solid var(--line);
  }
  .nav-drawer li:last-child a { border-bottom: 0; }
  .hero-side { align-self: stretch; }
  .work-grid { grid-template-columns: minmax(0, 1fr); }
  .trio { grid-template-columns: minmax(0, 1fr); }
  .split { gap: 28px; }
}

@media (max-width: 640px) {
  .cert-grid { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .btn-row .btn { flex: 1 1 100%; }
  .portrait, .stats { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .rule-in { transform: scaleX(1); }
}
