/* ============================================================
   ialakey.github.io — portfolio
   Dark-first, no framework, no build step.
   ============================================================ */

:root {
  --bg:        #0a0c10;
  --bg-soft:   #10131a;
  --surface:   rgba(255, 255, 255, 0.028);
  --surface-2: rgba(255, 255, 255, 0.05);
  --line:      rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);

  --text:      #e8ecf3;
  --text-dim:  #98a2b3;
  --text-mute: #6b7484;

  --accent:      #4ade9a;
  --accent-2:    #38bdf8;
  --accent-glow: rgba(74, 222, 154, 0.16);
  --accent-ink:  #05140c;

  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1140px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg:        #f7f8fa;
  --bg-soft:   #ffffff;
  --surface:   rgba(15, 23, 42, 0.022);
  --surface-2: rgba(15, 23, 42, 0.045);
  --line:      rgba(15, 23, 42, 0.11);
  --line-soft: rgba(15, 23, 42, 0.07);

  --text:      #10151f;
  --text-dim:  #4a5566;
  --text-mute: #737e8f;

  --accent:      #0e9f6e;
  --accent-2:    #0284c7;
  --accent-glow: rgba(14, 159, 110, 0.13);
  --accent-ink:  #ffffff;

  --shadow: 0 16px 40px -22px rgba(15, 23, 42, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

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

a { color: inherit; }

h1, h2, h3, h4 { line-height: 1.18; margin: 0; letter-spacing: -0.02em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip:focus { left: 0; }

/* ── background ── */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
  opacity: 0.9;
}
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none;
  top: -280px; left: 50%; transform: translateX(-50%);
  width: 1000px; height: 700px;
  background:
    radial-gradient(closest-side, var(--accent-glow), transparent 70%),
    radial-gradient(closest-side, rgba(56, 189, 248, 0.10), transparent 72%);
  background-position: 22% 40%, 78% 30%;
  background-repeat: no-repeat;
  background-size: 62% 90%, 62% 90%;
  filter: blur(10px);
}

/* ── nav ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 20px; height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; }
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: -0.03em;
}
.brand-text { font-size: 15px; }

.nav-links { margin-left: auto; display: flex; gap: 4px; }
.nav-links a {
  padding: 7px 12px; border-radius: 8px;
  font-size: 14px; color: var(--text-dim); text-decoration: none;
  transition: color .18s ease, background .18s ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--accent); }

.theme-toggle {
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--text-dim);
  cursor: pointer; transition: color .18s ease, border-color .18s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.theme-toggle .ico-moon { display: none; }
html[data-theme="light"] .theme-toggle .ico-sun { display: none; }
html[data-theme="light"] .theme-toggle .ico-moon { display: block; }

/* ── hero ── */
.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center;
  padding-top: 92px; padding-bottom: 88px;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 22px;
  padding: 6px 13px 6px 11px;
  border: 1px solid var(--line); border-radius: 100px;
  background: var(--surface);
  font-family: var(--mono); font-size: 12.5px; color: var(--text-dim);
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  font-size: clamp(44px, 7vw, 74px);
  font-weight: 800; letter-spacing: -0.045em;
  background: linear-gradient(170deg, var(--text) 30%, color-mix(in srgb, var(--text) 55%, transparent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.role {
  margin: 10px 0 0;
  font-family: var(--mono); font-size: clamp(15px, 2vw, 18px); font-weight: 500;
  color: var(--accent); letter-spacing: -0.01em;
}
.lede {
  margin: 22px 0 0; max-width: 56ch;
  font-size: 17px; color: var(--text-dim);
}
.lede strong { color: var(--text); font-weight: 600; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 17px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text); text-decoration: none;
  font-size: 14.5px; font-weight: 550;
  transition: transform .16s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.fill { fill: currentColor; stroke: none; }
.btn:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); }
.btn-primary {
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2)));
  border-color: transparent; color: var(--accent-ink); font-weight: 650;
}
.btn-primary:hover { color: var(--accent-ink); filter: brightness(1.07); }
.btn-ghost { background: transparent; }

/* ── terminal panel ── */
.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft); box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots i:first-child { background: color-mix(in srgb, #ff5f57 70%, var(--line)); }
.dots i:nth-child(2) { background: color-mix(in srgb, #febc2e 70%, var(--line)); }
.dots i:last-child  { background: color-mix(in srgb, #28c840 70%, var(--line)); }
.panel-title { font-family: var(--mono); font-size: 12px; color: var(--text-mute); }

.panel-body { padding: 18px 18px 20px; font-family: var(--mono); font-size: 13px; }
.panel-body hr { border: 0; border-top: 1px dashed var(--line); margin: 14px 0; }
.panel-line { display: flex; align-items: baseline; gap: 9px; margin: 0 0 9px; }
.panel-line:last-child { margin-bottom: 0; }
.panel-line .k { min-width: 68px; color: var(--text-mute); }
.panel-line .v { color: var(--text); font-weight: 500; }
.panel-line .v.num { color: var(--accent-2); font-variant-numeric: tabular-nums; font-weight: 700; }
.panel-line .v.ok { color: var(--accent); }
.panel-line .v.up { color: var(--accent); font-weight: 700; }
.panel-line .c { margin-left: auto; color: var(--text-mute); font-size: 11.5px; opacity: .75; }

/* ── sections ── */
.section { padding-block: 76px; border-top: 1px solid var(--line-soft); }

.h2 {
  display: flex; align-items: baseline; gap: 14px;
  font-size: clamp(26px, 3.6vw, 34px); font-weight: 700;
}
.h2-num {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--accent); opacity: .8; letter-spacing: 0;
}
.section-lede { margin: 12px 0 40px; color: var(--text-dim); max-width: 62ch; }

/* ── impact cards ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 16px; }
.card {
  position: relative; overflow: hidden;
  padding: 24px 22px 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--accent-glow), transparent 62%);
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card:hover::after { opacity: 1; }
.card-ico {
  display: grid; place-items: center;
  width: 38px; height: 38px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-soft); color: var(--accent);
}
.card-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 17px; font-weight: 650; }
.card p { margin: 10px 0 0; font-size: 14.5px; color: var(--text-dim); }
.card-proof {
  margin-top: 16px !important; padding-top: 13px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--accent) !important;
}

/* ── timeline ── */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(180deg, var(--accent), var(--line) 45%, transparent);
}
.tl-item { position: relative; padding-left: 34px; padding-bottom: 44px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--accent); background: var(--bg);
}
.tl-item:not(:first-child)::before { border-color: var(--line); }

.tl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.tl-date { font-family: var(--mono); font-size: 12.5px; color: var(--text-mute); }
.tl-tag {
  padding: 2px 9px; border: 1px solid var(--line); border-radius: 100px;
  font-size: 11.5px; color: var(--text-dim); background: var(--surface);
}
.tl-body { max-width: 78ch; }
.tl-body h3 { font-size: 19px; font-weight: 650; }
.tl-body h3 .at { color: var(--text-dim); font-weight: 450; font-size: 16px; }
.tl-body ul { margin: 14px 0 0; padding-left: 0; list-style: none; }
.tl-body li { position: relative; padding-left: 20px; margin-bottom: 8px; color: var(--text-dim); font-size: 15px; }
.tl-body li::before {
  content: ""; position: absolute; left: 3px; top: 10px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .55;
}
.tl-body li strong { color: var(--text); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; }
.chips span {
  padding: 4px 10px;
  border: 1px solid var(--line-soft); border-radius: 7px;
  background: var(--surface);
  font-family: var(--mono); font-size: 11.5px; color: var(--text-dim);
}
.chips.big span { padding: 6px 12px; font-size: 12.5px; }

/* ── projects ── */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.proj {
  display: flex; flex-direction: column;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-decoration: none;
  transition: transform .2s ease, border-color .2s ease;
}
.proj:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.proj-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.proj-name { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--text); }
.proj:hover .proj-name { color: var(--accent); }
.proj-stars {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 12px; color: var(--text-mute);
  opacity: 0; transition: opacity .4s ease;
}
.proj-stars.loaded { opacity: 1; }
.proj-stars svg { width: 13px; height: 13px; fill: currentColor; }
.proj-desc { margin: 0 0 16px; font-size: 14px; color: var(--text-dim); flex: 1; }
.proj-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.proj-lang { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-mute); font-family: var(--mono); }
.proj-lang i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-mute); }
.badge {
  padding: 3px 9px; border-radius: 100px;
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent); background: var(--accent-glow);
}
.more { margin-top: 28px; }

/* ── stack ── */
.stack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 26px; }
.stack-col h3 {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--text-mute); text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 12px;
}

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px;
  margin-top: 44px;
}
.fact {
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.fact h4 {
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  color: var(--accent); text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 10px;
}
.fact p { margin: 0; font-size: 14.5px; color: var(--text-dim); }
.fact a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.fact a:hover { color: var(--accent); border-color: var(--accent); }
.muted { color: var(--text-mute); font-size: 13px; }

/* ── contact ── */
.contact { text-align: center; }
.contact .h2 { justify-content: center; }
.contact-lede { margin: 14px auto 34px; max-width: 52ch; color: var(--text-dim); font-size: 17px; }
.contact-links {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px; max-width: 900px; margin-inline: auto;
}
.clink {
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  padding: 18px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}
.clink:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.clink-k { font-family: var(--mono); font-size: 11.5px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .08em; }
.clink-v { font-size: 14.5px; font-weight: 550; word-break: break-all; }
.clink:hover .clink-v { color: var(--accent); }
.contact-cta { margin-top: 34px; }

/* ── footer ── */
.footer { border-top: 1px solid var(--line-soft); padding-block: 26px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.footer p { margin: 0; font-size: 13px; color: var(--text-mute); }
.footer .mono { font-family: var(--mono); font-size: 12px; }
.footer a { color: var(--text-dim); }
.footer a:hover { color: var(--accent); }

/* ── reveal on scroll ── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── responsive ── */
@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 64px; padding-bottom: 64px; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: 18px; }
  .section { padding-block: 58px; }
  .btn { padding: 10px 14px; font-size: 14px; }
  .panel-line { flex-wrap: wrap; }
  .panel-line .c { margin-left: 0; width: 100%; }
  .footer-inner { flex-direction: column; }
}

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

@media print {
  .nav, .bg-grid, .bg-glow, .theme-toggle, .cta, .contact-cta { display: none; }
  body { background: #fff; color: #000; }
}
