/* =============================================================
   soltanov.io - "Instrument Panel"
   Warm near-black · graph-paper grid · single gold signal
   Fraunces (display serif) · Space Mono (data) · Hanken Grotesk (body)
   Shared by index.html and verification.html
   ============================================================= */

:root {
  --bg:        #0b0b0a;
  --bg-2:      #100f0d;
  --panel:     #131210;
  --panel-2:   #17150f;
  --line:      rgba(240, 235, 220, 0.05);   /* graph grid */
  --border:    #2a2822;
  --border-2:  #37342b;
  --ink:       #f2efe6;                       /* warm off-white */
  --muted:     #a29c8b;
  --faint:     #6b6656;
  --accent:    #e6b24a;                       /* gold signal (medals) */
  --accent-hi: #ffd479;
  --accent-dim: rgba(230, 178, 74, 0.14);
  --accent-ink: #17140c;

  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Hanken Grotesk", system-ui, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, monospace;

  --maxw: 1000px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Graph-paper grid + soft vignette, fixed behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 58px 58px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 55%, transparent 100%);
          mask-image: radial-gradient(120% 90% at 50% 0%, #000 55%, transparent 100%);
}
/* Single warm glow, top */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(680px circle at 78% -6%, rgba(230, 178, 74, 0.10), transparent 60%);
}
/* Fine film grain for texture over the flat near-black */
html::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.wrap { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 0 26px; }

a { color: inherit; }

/* ---------- Nav ---------- */
nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand {
  font-family: var(--font-mono); font-weight: 700; font-size: 15px;
  letter-spacing: -0.3px; text-decoration: none; color: var(--ink);
}
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.2px;
  color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: 6px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--panel-2); }
.nav-back { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); text-decoration: none; transition: color .2s; }
.nav-back:hover { color: var(--accent); }
@media (max-width: 700px) { .nav-links { display: none; } }

/* ---------- Shared eyebrow / section heads ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent);
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--accent); display: inline-block; opacity: .7;
}
.sec-num { color: var(--faint); }

section { padding: 70px 0; border-top: 1px solid var(--border); position: relative; }
h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -0.5px; line-height: 1.08;
  margin: 16px 0 10px;
  font-variation-settings: "opsz" 120, "SOFT" 0, "WONK" 0;
}
.lead { color: var(--muted); max-width: 64ch; font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px; border-radius: 7px; font-weight: 600; font-size: 14.5px;
  font-family: var(--font-body); text-decoration: none;
  transition: transform .16s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s, color .2s;
}
.btn .arw { transition: transform .18s var(--ease); }
.btn:hover .arw { transform: translateX(3px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent); }
.btn-primary:hover { background: var(--accent-hi); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(230,178,74,0.28); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
header.hero { padding: 78px 0 54px; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 52px; align-items: center; }
@media (max-width: 760px) { .hero-grid { grid-template-columns: 1fr; gap: 34px; } }

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .4px;
  color: var(--accent); background: var(--accent-dim);
  border: 1px solid rgba(230,178,74,0.28);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 26px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); }

h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 4.6rem); line-height: 0.98; letter-spacing: -1.5px;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
}
h1 .role { display: block; font-style: italic; color: var(--accent); font-weight: 500; }
.lede { margin-top: 20px; color: var(--muted); font-size: 1.14rem; max-width: 46ch; }

.coords {
  margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .5px; color: var(--faint);
}
.coords b { color: var(--muted); font-weight: 400; }

.cta { margin-top: 30px; display: flex; gap: 13px; flex-wrap: wrap; }

.portrait { position: relative; width: fit-content; }
.portrait img {
  width: 190px; height: 232px; object-fit: cover;
  border-radius: 4px; filter: grayscale(0.15) contrast(1.02);
  border: 1px solid var(--border-2);
}
.portrait::before, .portrait::after {
  content: ""; position: absolute; width: 20px; height: 20px; border: 2px solid var(--accent);
}
.portrait::before { top: -8px; left: -8px; border-width: 2px 0 0 2px; }
.portrait::after { bottom: -8px; right: -8px; border-width: 0 2px 2px 0; }
@media (max-width: 760px) { .portrait img { width: 150px; height: 184px; } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 54px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
@media (max-width: 680px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 22px; border-right: 1px solid var(--border); background: var(--panel); }
.stat:last-child { border-right: none; }
@media (max-width: 680px) { .stat:nth-child(2) { border-right: none; } .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--border); } }
.stat .num { font-family: var(--font-mono); font-weight: 700; font-size: 2rem; color: var(--accent); letter-spacing: -1px; }
.stat .lbl { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Featured project ---------- */
.feature {
  position: relative; background: var(--panel);
  border: 1px solid var(--border-2); border-radius: 8px; padding: 32px;
}
.feature::before, .feature::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid var(--accent); }
.feature::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.feature::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.feature .meta { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: .5px; }
.feature h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; letter-spacing: -0.3px; margin: 8px 0 10px; }
.feature > p { color: var(--muted); max-width: 68ch; }
.feature ul { list-style: none; margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px 26px; }
@media (max-width: 640px) { .feature ul { grid-template-columns: 1fr; } }
.feature li { color: var(--muted); font-size: 0.95rem; padding-left: 22px; position: relative; }
.feature li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-family: var(--font-mono); }

/* ---------- Chips / tags ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  background: var(--bg-2); border: 1px solid var(--border); padding: 6px 11px; border-radius: 5px;
  transition: color .2s, border-color .2s, background .2s;
}
.chip:hover { color: var(--accent); border-color: rgba(230,178,74,0.45); background: var(--panel); }
.feature .chips { margin-top: 20px; }

/* ---------- Cards grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 24px;
  transition: transform .18s var(--ease), border-color .2s, background .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-2); background: var(--panel-2); }
.card .k { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 1px; }
.card h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.12rem; margin: 8px 0 6px; letter-spacing: -0.2px; }
.card p { color: var(--muted); font-size: 0.93rem; }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-left: 6px; padding-left: 30px; border-left: 1px solid var(--border-2); }
.job { position: relative; padding-bottom: 40px; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: -36px; top: 6px; width: 11px; height: 11px;
  background: var(--bg); border: 2px solid var(--accent); border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(230,178,74,0.10);
}
.job .when { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: .5px; }
.job h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.28rem; margin: 5px 0 2px; letter-spacing: -0.3px; }
.job .role { color: var(--ink); font-weight: 500; margin-bottom: 12px; font-size: 0.96rem; opacity: .8; }
.job ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.job li { color: var(--muted); font-size: 0.95rem; padding-left: 20px; position: relative; }
.job li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 40px; }
@media (max-width: 640px) { .skills { grid-template-columns: 1fr; } }
.skillgroup h4 { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--faint); margin-bottom: 13px; }

/* ---------- Panels (edu / verification) ---------- */
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .twocol { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 26px; }
.panel h4 { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--faint); margin-bottom: 15px; }
.entry { margin-bottom: 15px; }
.entry:last-child { margin-bottom: 0; }
.entry .t { font-weight: 600; font-size: 0.99rem; }
.entry .s { color: var(--muted); font-size: 0.88rem; font-family: var(--font-mono); }
.medals { display: flex; flex-direction: column; gap: 11px; }
.medal { display: flex; align-items: baseline; gap: 11px; color: var(--muted); font-size: 0.95rem; }
.medal b { color: var(--ink); font-weight: 600; }
.medal .m { font-family: var(--font-mono); color: var(--accent); font-size: 0.85rem; }

/* ---------- Definition rows (verification) ---------- */
.rows { display: grid; grid-template-columns: max-content 1fr; gap: 11px 26px; }
@media (max-width: 520px) { .rows { grid-template-columns: 1fr; gap: 2px 0; } .rows dd { margin-bottom: 12px; } }
.rows dt { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); align-self: center; }
.rows dd { color: var(--ink); font-weight: 500; }
.prose p { color: var(--muted); margin-bottom: 11px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
ul.ticks { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
ul.ticks li { color: var(--muted); padding-left: 22px; position: relative; }
ul.ticks li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.a-link { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s; }
.a-link:hover { border-color: var(--accent); }

/* ---------- Contact ---------- */
.contact {
  position: relative; text-align: center;
  border: 1px solid var(--border-2); border-radius: 12px; padding: 52px 32px;
  background:
    radial-gradient(500px circle at 50% 0%, rgba(230,178,74,0.08), transparent 70%),
    var(--panel);
}
.contact h2 { margin-top: 12px; }
.contact .lead { margin: 10px auto 0; }
.contact-links { display: flex; gap: 13px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 24px; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
footer, footer a { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ---------- Verification header ---------- */
header.doc { padding: 60px 0 30px; }
.doc-id { display: flex; align-items: center; gap: 22px; margin-top: 24px; }
.doc-id img { width: 96px; height: 118px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border-2); filter: grayscale(0.15); }
.doc-id h1 { font-size: clamp(2rem, 5vw, 2.9rem); }
.doc-id .sub { color: var(--muted); margin-top: 6px; font-family: var(--font-mono); font-size: 0.9rem; letter-spacing: .3px; }

/* ---------- Load reveal (staggered) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: rise .75s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .04s; }
.stagger > *:nth-child(2) { animation-delay: .12s; }
.stagger > *:nth-child(3) { animation-delay: .20s; }
.stagger > *:nth-child(4) { animation-delay: .28s; }
.stagger > *:nth-child(5) { animation-delay: .36s; }
.stagger > *:nth-child(6) { animation-delay: .44s; }
.fade-up { animation: rise .8s var(--ease) both; }

/* ---------- Ghosted section index numerals (editorial watermark) ---------- */
section[data-num]::before {
  content: attr(data-num);
  position: absolute; top: 30px; right: 28px; z-index: 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(5rem, 13vw, 10.5rem); line-height: 0.8;
  color: var(--ink); opacity: 0.035;
  pointer-events: none; user-select: none;
  font-variation-settings: "opsz" 144, "SOFT" 0;
}
@media (max-width: 640px) { section[data-num]::before { top: 22px; right: 16px; opacity: .05; } }

/* ---------- Live "available" pulse on the hero signal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .pill .dot { animation: signal 2.6s var(--ease) infinite; }
}
@keyframes signal {
  0%, 100% { box-shadow: 0 0 9px var(--accent); opacity: 1; }
  50%      { box-shadow: 0 0 15px 2px var(--accent); opacity: .78; }
}

/* ---------- Scroll reveal (one-shot: fade + rise once, then locked) ----------
   Hidden state is gated on html.js AND no-preference, so content is never
   hidden without JavaScript or for reduced-motion users. JS toggles .is-visible
   via IntersectionObserver and then stops observing (no reverse on scroll-up). */
@media (prefers-reduced-motion: no-preference) {
  html.js :is(
    section:not(.hero) > .wrap > .eyebrow,
    section:not(.hero) > .wrap > h2,
    section:not(.hero) > .wrap > .lead,
    .feature, .card, .job, .skillgroup, .panel, .contact
  ) {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .5s var(--ease), transform .5s var(--ease);
    transition-delay: var(--reveal-d, 0s);
  }
  html.js :is(
    section:not(.hero) > .wrap > .eyebrow,
    section:not(.hero) > .wrap > h2,
    section:not(.hero) > .wrap > .lead,
    .feature, .card, .job, .skillgroup, .panel, .contact
  ).is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Keyboard focus (accessible gold rings) ---------- */
a:focus-visible, .btn:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}
.skip {
  position: absolute; left: -9999px; top: 10px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  padding: 9px 15px; border-radius: 7px; text-decoration: none;
}
.skip:focus { left: 14px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .btn:hover, .card:hover { transform: none; }
}
