/* ==========================================================================
   Alperen Aslan — portfolio
   Design system (UI UX Pro Max): Portfolio/Personal → Minimalism & Swiss Style,
   Portfolio Grid pattern (visuals first), Phosphor icons (one family, outline),
   B2B palette (ink navy + single blue accent), IBM Plex Sans + JetBrains Mono.
   Radius 0, no shadows, no gradients.
   ========================================================================== */

:root {
  --ink-950: #020617; --ink-900: #0f172a; --ink-700: #334155; --ink-600: #475569;
  --ink-200: #e2e8f0; --ink-100: #f1f5f9; --ink-50: #f8fafc;
  --blue-700: #0369a1; --blue-100: #e0f2fe; --blue-300: #7dd3fc;

  --bg: var(--ink-50);
  --paper: #ffffff;
  --fg: var(--ink-950);
  --fg-2: var(--ink-700);
  --muted: var(--ink-600);
  --rule: var(--ink-200);
  --rule-strong: var(--ink-900);
  --accent: var(--blue-700);
  --accent-soft: var(--blue-100);
  --on-accent: #ffffff;
  --tint: var(--ink-100);
  --ok: #15803d;
  --focus: var(--blue-700);

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --max: 1240px; --gutter: 32px;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #020617; --paper: #0b1222; --fg: #f8fafc; --fg-2: #cbd5e1; --muted: #94a3b8;
    --rule: #1e293b; --rule-strong: #e2e8f0; --accent: var(--blue-300); --accent-soft: #0c2a43;
    --on-accent: #020617; --tint: #0f172a; --ok: #4ade80; --focus: var(--blue-300); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #020617; --paper: #0b1222; --fg: #f8fafc; --fg-2: #cbd5e1; --muted: #94a3b8;
  --rule: #1e293b; --rule-strong: #e2e8f0; --accent: var(--blue-300); --accent-soft: #0c2a43;
  --on-accent: #020617; --tint: #0f172a; --ok: #4ade80; --focus: var(--blue-300); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--on-accent); }
.ph { line-height: 1; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--fg); color: var(--bg); padding: 10px 14px; }
.skip:focus { left: 8px; }

/* icon box — square, Swiss */
.ibox { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 1px solid var(--rule-strong); font-size: 22px; color: var(--fg); background: var(--paper); }
.ibox--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Header ---------- */
.hdr { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.hdr__in { display: flex; align-items: center; gap: var(--s4); height: 60px; }
.brand { font-family: var(--mono); font-size: 14px; font-weight: 600; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand__mark { width: 22px; height: 22px; background: var(--fg); color: var(--bg); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.nav { display: flex; gap: var(--s3); margin-left: auto; }
.nav a { font-family: var(--mono); font-size: 13px; text-decoration: none; color: var(--fg-2); padding: 10px 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.nav a:hover { color: var(--fg); }
.nav a.is-active { color: var(--fg); border-bottom-color: var(--accent); }
.hdr__tools { display: flex; gap: 4px; }
.sq-btn { width: 44px; height: 44px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; color: var(--fg-2); font-size: 20px; text-decoration: none; transition: border-color .2s, color .2s; }
.sq-btn:hover { border-color: var(--rule-strong); color: var(--fg); }
.menu-btn { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; font-family: var(--mono); font-size: 14px; font-weight: 500; text-decoration: none; border: 1px solid var(--rule-strong); transition: background .2s, color .2s; }
.btn .ph { font-size: 18px; transition: transform .2s var(--ease); }
.btn:hover .ph-arrow-right { transform: translateX(3px); }
.btn--solid { background: var(--fg); color: var(--bg); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--line { background: transparent; color: var(--fg); }
.btn--line:hover { background: var(--fg); color: var(--bg); }

/* ---------- Hero ---------- */
.hero { padding: var(--s7) 0 var(--s6); }
.hero__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--s4); align-items: center; }
.hero__main { grid-column: 1 / 8; }
.hero__kicker { display: flex; align-items: center; gap: 12px; margin-bottom: var(--s4); }
.hero__kicker::before { content: ""; width: 32px; height: 2px; background: var(--accent); }
.hero h1 { font-size: clamp(40px, 5.6vw, 76px); line-height: 1.03; font-weight: 600; letter-spacing: -0.035em; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__lead { margin-top: var(--s3); max-width: 540px; font-size: 19px; line-height: 1.55; color: var(--fg-2); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--s5); }
.hero__art { grid-column: 8 / 13; }
.hero__art svg { width: 100%; height: auto; }

/* Impact numbers */
.impact { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--rule-strong); margin-top: var(--s6); }
.impact div { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s3) var(--s3) var(--s3) 0; border-right: 1px solid var(--rule); }
.impact div + div { padding-left: var(--s3); }
.impact div:last-child { border-right: 0; }
.impact .ph { font-size: 26px; color: var(--accent); margin-top: 4px; }
.impact b { display: block; font-family: var(--mono); font-size: 30px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.impact span { font-size: 14px; color: var(--muted); line-height: 1.4; display: block; margin-top: 4px; }

/* ---------- Section scaffolding ---------- */
.sec { padding: var(--s7) 0 0; }
.sec__head { display: flex; justify-content: space-between; align-items: end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s4); padding-bottom: var(--s3); border-bottom: 2px solid var(--rule-strong); }
.sec__head h2 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; font-weight: 600; letter-spacing: -0.025em; margin-top: 8px; }
.sec__head p { color: var(--fg-2); max-width: 420px; font-size: 16px; }

/* ---------- Work tiles (Portfolio Grid) ---------- */
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s3); }
.tile { grid-column: span 2; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--rule); transition: border-color .2s; }
.tile:hover { border-color: var(--rule-strong); }
.tile--wide { grid-column: span 3; }
.tile__art {
  aspect-ratio: 16 / 10; border-bottom: 1px solid var(--rule); position: relative; overflow: hidden;
  background-color: var(--tint);
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 24px 24px;
}
.tile__art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile__body { padding: var(--s3); display: flex; flex-direction: column; gap: 12px; flex: 1; }
.tile__top { display: flex; align-items: center; gap: 12px; }
.tile__num { margin-left: auto; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.tile h3 { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; }
.tile__impact { color: var(--fg-2); font-size: 16px; }
.wins { display: grid; gap: 8px; }
.wins li { display: flex; gap: 10px; font-size: 15px; color: var(--fg); line-height: 1.45; }
.wins .ph { color: var(--ok); font-size: 18px; margin-top: 1px; flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.tags li { font-family: var(--mono); font-size: 12px; padding: 3px 8px; border: 1px solid var(--rule); color: var(--muted); }

/* visual primitives inside SVG art (theme-aware) */
.v-ink { stroke: var(--fg); }
.v-fill-ink { fill: var(--fg); }
.v-fill-paper { fill: var(--paper); }
.v-fill-accent { fill: var(--accent); }
.v-fill-soft { fill: var(--accent-soft); }
.v-stroke-accent { stroke: var(--accent); }
.v-txt { fill: var(--fg); font-family: var(--mono); }
.v-txt-muted { fill: var(--muted); font-family: var(--mono); }
.v-txt-on { fill: var(--on-accent); font-family: var(--mono); }
.v-ok { fill: var(--ok); }

/* ---------- Small projects ---------- */
.minis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin-top: var(--s3); }
.mini { display: flex; gap: var(--s2); padding: var(--s3); border: 1px solid var(--rule); background: var(--paper); }
.mini h3 { font-size: 17px; font-weight: 600; }
.mini p { font-size: 15px; color: var(--fg-2); margin-top: 4px; line-height: 1.5; }

/* ---------- How I work ---------- */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
.principles li { display: flex; flex-direction: column; gap: 12px; padding-top: var(--s2); border-top: 1px solid var(--rule-strong); }
.principles h3 { font-size: 17px; font-weight: 600; }
.principles p { font-size: 15px; color: var(--fg-2); margin-top: -6px; }

/* ---------- Experience timeline ---------- */
.tl { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--rule-strong); }
.tl li { position: relative; padding: var(--s3) var(--s3) var(--s3) 0; }
.tl li + li { padding-left: var(--s3); border-left: 1px solid var(--rule); }
.tl li::before { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; background: var(--bg); border: 2px solid var(--rule-strong); }
.tl li + li::before { left: var(--s3); }
.tl li.now::before { background: var(--accent); border-color: var(--accent); }
.tl .when { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: 10px 0 6px; display: block; }
.tl h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.tl .org { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--fg-2); font-size: 15px; }
.tl .org .ph { font-size: 18px; color: var(--accent); }
.tl p { font-size: 15px; color: var(--fg-2); margin-top: 10px; }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.skill { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: var(--s3) var(--s2); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--paper); transition: background .2s, color .2s; }
.skill .ph { font-size: 30px; color: var(--accent); }
.skill b { font-size: 15px; font-weight: 600; line-height: 1.3; }
.skill span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.skill--sf { box-shadow: inset 0 -4px 0 var(--accent); }
.skill--sf img { height: 30px; width: auto; }

.strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--s4); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--rule); background: var(--paper); font-size: 14px; color: var(--fg-2); text-decoration: none; }
.chip .ph { font-size: 18px; color: var(--accent); }
.chip small { font-family: var(--mono); font-size: 12px; color: var(--muted); }
a.chip:hover { border-color: var(--rule-strong); color: var(--fg); }
.subhead { margin-top: var(--s5); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--s4); }
.contact__l { grid-column: 1 / 6; }
.contact__big { font-size: clamp(32px, 4vw, 56px); line-height: 1.05; font-weight: 600; letter-spacing: -0.03em; }
.contact__links { margin-top: var(--s4); border-top: 1px solid var(--rule); }
.contact__links a { display: flex; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--rule); text-decoration: none; font-family: var(--mono); font-size: 14px; }
.contact__links a .ph:first-child { font-size: 22px; color: var(--accent); }
.contact__links a .ph:last-child { margin-left: auto; transition: transform .2s var(--ease); }
.contact__links a:hover .ph:last-child { transform: translate(3px, -3px); }
.form { grid-column: 7 / 13; display: grid; gap: var(--s3); }
.form__two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.field label { display: block; margin-bottom: 8px; }
.field input, .field textarea { width: 100%; font: inherit; font-size: 16px; color: var(--fg); background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 0; padding: 12px 14px; min-height: 48px; transition: border-color .2s, box-shadow .2s; }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.form__foot { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.status { font-family: var(--mono); font-size: 13px; }
.status.ok { color: var(--ok); }
.status.err { color: #dc2626; }

/* ---------- Footer ---------- */
.ftr { margin-top: var(--s7); border-top: 1px solid var(--rule); padding: var(--s3) 0 var(--s4); }
.ftr__in { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.ftr a { text-decoration: none; }

/* ---------- Reveal ---------- */
.js .rv { opacity: 0; transform: translateY(12px); transition: opacity .35s ease-out, transform .35s ease-out; }
.js .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0s !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero__main { grid-column: 1 / -1; }
  .hero__art { grid-column: 1 / -1; max-width: 560px; }
  .impact { grid-template-columns: repeat(2, 1fr); }
  .impact div:nth-child(2) { border-right: 0; }
  .impact div:nth-child(3) { padding-left: 0; }
  .impact div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .tile, .tile--wide { grid-column: span 3; }
  .minis { grid-template-columns: 1fr 1fr; }
  .principles { grid-template-columns: repeat(2, 1fr); }
  .tl { grid-template-columns: repeat(2, 1fr); }
  .tl li:nth-child(3) { padding-left: 0; border-left: 0; }
  .tl li:nth-child(3)::before { left: 0; }
  .tl li:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .skills { grid-template-columns: repeat(7, 1fr); }
  .skill { padding: var(--s2) 12px; }
  .skill span { font-size: 11px; }
  .contact__l, .form { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .menu-btn { display: grid; }
  .nav { position: absolute; top: 60px; left: 0; right: 0; display: none; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--rule-strong); padding: 0 var(--gutter) var(--s2); }
  .hdr.open .nav { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .nav a.is-active { border-bottom-color: var(--rule); color: var(--accent); }
  .hdr__tools .sq-btn[href] { display: none; }
  .hero { padding: var(--s5) 0 var(--s5); }
  .hero__lead { font-size: 17px; }
  .impact div, .impact div + div { padding: var(--s2) var(--s1) var(--s2) 0; }
  .impact div:nth-child(even) { padding-left: var(--s2); }
  .impact b { font-size: 24px; }
  .impact .ph { font-size: 22px; }
  .sec { padding-top: var(--s6); }
  .tiles { grid-template-columns: 1fr; }
  .tile, .tile--wide { grid-column: 1 / -1; }
  .minis, .principles, .tl { grid-template-columns: 1fr; }
  .tl li, .tl li + li { padding: var(--s3) 0; border-left: 0; }
  .tl li::before, .tl li + li::before { left: 0; }
  .tl li + li { border-top: 1px solid var(--rule); }
  .skills { grid-template-columns: 1fr 1fr; }
  .form__two { grid-template-columns: 1fr; }
}
