/* ============================================================
   Akosh — portfolio
   Monochrome dark theme. Palette taken from the profile artwork:
   black ink, white paper, grey hatching. No hues.
   ============================================================ */

:root {
  --bg:        #050505;
  --bg-alt:    #0a0a0a;
  --surface:   rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);

  --line:        rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.26);

  --text:       #fafafa;
  --text-dim:   rgba(255, 255, 255, 0.64);
  --text-faint: rgba(255, 255, 255, 0.42);

  --grid: rgba(255, 255, 255, 0.07);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-12: 6rem;

  --radius:    18px;
  --radius-sm: 12px;
  --wrap:      1180px;
  --header-h:  70px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur:  240ms;
}

/* ── Base ─────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Keeps anchor targets and keyboard focus clear of the sticky header. */
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Sora", "Inter", sans-serif;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.8vw, 2.8rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }

p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-2);
  z-index: 200;
  background: #fff;
  color: #050505;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus-visible { top: var(--space-2); }

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 4px;
}

.icon {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-lg { width: 30px; height: 30px; }

/* Brand marks are desaturated rather than flattened to a solid fill, so
   multi-tone logos like SQLite keep their internal shapes while the page
   stays strictly monochrome. */
.btn-logo,
.tile-icon img,
.skill-strip img,
.marquee-group img { filter: grayscale(1) brightness(1.75); }

.btn-primary .btn-logo { filter: grayscale(1) brightness(0.3); }

/* ── Backdrop ─────────────────────────────────────────── */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.backdrop-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 90% at 12% 0%, rgba(255, 255, 255, 0.10), transparent 65%),
    radial-gradient(ellipse 40% 75% at 88% 0%, rgba(255, 255, 255, 0.06), transparent 70%),
    var(--bg);
}

/* Ticked grid: a full grid masked down to short dashes at each intersection. */
.backdrop-grid {
  position: absolute;
  inset: 0;
  opacity: 0.9;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image:
    repeating-linear-gradient(to right, #000 0 3px, transparent 3px 9px),
    repeating-linear-gradient(to bottom, #000 0 3px, transparent 3px 9px);
  mask-image:
    repeating-linear-gradient(to right, #000 0 3px, transparent 3px 9px),
    repeating-linear-gradient(to bottom, #000 0 3px, transparent 3px 9px);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.backdrop-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 48%, var(--bg) 100%);
}

/* ── Scroll progress ──────────────────────────────────── */

.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 120;
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  transition: width 80ms linear;
}

/* ── Header ───────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.site-header.is-stuck {
  background: rgba(5, 5, 5, 0.76);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.95rem;
}

.brand-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #fff;
  flex-shrink: 0;
}

.brand-dim { color: var(--text-faint); }

.nav { margin-left: auto; display: flex; gap: var(--space-3); }

.nav-link {
  position: relative;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.4rem 0;
  transition: color var(--dur) var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1.5px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease);
}

.nav-link:hover, .nav-link.is-active { color: var(--text); }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); transform-origin: left; }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease);
}
.icon-btn:hover { border-color: var(--line-strong); }

.nav-toggle { display: none; }

/* ── Buttons ──────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.45rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
              border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* Solid white on near-black — the strongest contrast available in a
   monochrome palette, and it stays legible at every size. */
.btn-primary {
  background: #fff;
  color: #050505;
  border-color: #fff;
}
.btn-primary:hover { transform: translateY(-2px); background: #d9d9d9; border-color: #d9d9d9; }
.btn-primary .icon { stroke-width: 1.8; }

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { transform: translateY(-2px); background: var(--surface-2); border-color: #fff; }

.btn-sm { padding: 0.6rem 1.1rem; font-size: 0.87rem; }
.btn-logo { width: 20px; height: 20px; }
.btn-primary .btn-logo { filter: brightness(0); }

/* ── Hero ─────────────────────────────────────────────── */

.hero {
  position: relative;
  z-index: 2;
  padding-block: clamp(var(--space-8), 9vw, var(--space-12)) var(--space-12);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-8);
  align-items: center;
}

.hero-text { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.79rem;
  color: var(--text-dim);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  animation: pulse 2.4s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
  70%  { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Emphasis without colour: the connecting words recede, the subjects stay
   full white. Avoids hollow/outlined type, which lets the backdrop grid
   show through the glyphs. */
h1 { color: rgba(255, 255, 255, 0.40); }
h1 .hl { color: #fff; }

.lead { font-size: 1.08rem; color: var(--text-dim); max-width: 52ch; }
.lead strong { color: var(--text); font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.skill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  list-style: none;
  margin: var(--space-3) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  width: 100%;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.83rem;
  color: var(--text-dim);
}

.skill-strip li { display: inline-flex; align-items: center; gap: 0.5rem; }
.skill-strip img { width: 18px; height: 18px; opacity: 0.85; }

/* ── Portrait ─────────────────────────────────────────── */

.hero-portrait { position: relative; justify-self: center; }

.portrait-ring {
  width: min(330px, 74vw);
  aspect-ratio: 1;
  padding: 1.5px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,255,255,0.9), rgba(255,255,255,0.12), rgba(255,255,255,0.9));
  animation: spin 16s linear infinite;
  box-shadow: 0 0 70px -18px rgba(255, 255, 255, 0.45);
}

@keyframes spin { to { transform: rotate(360deg); } }

.portrait-frame {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  /* Cancels the ring's rotation so the portrait stays upright. */
  animation: spin 16s linear infinite reverse;
}

.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }

.portrait-tag {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(8px);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  white-space: nowrap;
}

.scroll-cue {
  position: absolute;
  bottom: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-dim);
  animation: bob 2.6s ease-in-out infinite;
}
.scroll-cue:hover { color: var(--text); border-color: var(--line-strong); }

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, -8px); }
}

/* ── Marquee ──────────────────────────────────────────── */

.marquee-section {
  position: relative;
  z-index: 2;
  padding-block: var(--space-4);
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-inner {
  display: flex;
  width: max-content;
  animation: scroll-x 28s linear infinite;
}

/* Two full-viewport groups. A -50% shift then equals one screen width,
   so the strip stays filled on both sides and the loop has no gap. */
.marquee-group {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  flex: 0 0 100vw;
  width: 100vw;
  margin: 0;
  padding: 0;
  list-style: none;
}

.marquee:hover .marquee-inner { animation-play-state: paused; }

@keyframes scroll-x {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee-group img {
  height: 30px;
  width: auto;
  opacity: 0.45;
  transition: opacity var(--dur) var(--ease);
}
.marquee-group li:hover img { opacity: 1; }

/* ── Sections ─────────────────────────────────────────── */

.section {
  position: relative;
  z-index: 2;
  padding-block: clamp(var(--space-8), 8vw, var(--space-12));
}

.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

.section-head { margin-bottom: var(--space-6); max-width: 62ch; }
.section-head.center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--text-faint);
  margin-bottom: 0.9rem;
}

.section-sub { margin-top: var(--space-2); color: var(--text-dim); }

/* ── Bento tiles ──────────────────────────────────────── */

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(130px, auto);
  gap: var(--space-2);
}

.tile-hero { grid-column: span 4; grid-row: span 2; }
.tile-sm   { grid-column: span 2; }
.tile-md   { grid-column: span 3; }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 60% 120% at 12% 0%, rgba(255, 255, 255, 0.08), transparent 72%),
    var(--surface);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.tile:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.tile-hero { padding: var(--space-4); }
.tile p { color: var(--text-dim); font-size: 0.94rem; }
.tile p strong { color: var(--text); font-weight: 600; }
.tile > * { position: relative; z-index: 1; }

/* Cursor-tracking spotlight; --mx/--my are set from JS on pointer move. */
.card-spot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(
    340px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.10),
    transparent 65%
  );
  transition: opacity var(--dur) var(--ease);
}
.card-spot:hover::before { opacity: 1; }

.tile-top { display: flex; align-items: center; justify-content: space-between; }

.tile-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}

.tile-icon {
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  flex-shrink: 0;
}

.tile-icon-float { animation: t-float 6s ease-in-out infinite; }
.tile-icon-pulse { animation: t-pulse 4s ease-in-out infinite; }
.tile-icon-tilt  { animation: t-tilt 5.5s ease-in-out infinite; }
.tile-icon-drift { animation: t-drift 8s ease-in-out infinite; }
.tile-icon-glow  { animation: t-glow 7s ease-in-out infinite; }

@keyframes t-float { 0%, 100% { transform: translateY(0); }      50% { transform: translateY(-6px); } }
@keyframes t-pulse { 0%, 100% { transform: scale(1); }           50% { transform: scale(1.08); } }
@keyframes t-tilt  { 0%, 100% { transform: rotate(-3deg); }      50% { transform: rotate(3deg); } }
@keyframes t-drift { 0%, 100% { transform: translate(0, 0); }    50% { transform: translate(5px, -5px); } }
@keyframes t-glow  { 0%, 100% { opacity: 0.75; }                 50% { opacity: 1; } }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: auto 0 0;
  padding: 0;
}

.tags li {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
}

/* ── About ────────────────────────────────────────────── */

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-6);
  align-items: start;
}

.about-p { color: var(--text-dim); margin-top: var(--space-2); font-size: 1.02rem; max-width: 56ch; }
.about-grid .btn { margin-top: var(--space-3); }

.fact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.fact-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem var(--space-2);
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--line);
}
.fact-list li:last-child { border-bottom: 0; }

.fact-key {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-faint);
}

.fact-val { font-size: 0.93rem; text-align: right; display: inline-flex; align-items: center; gap: 0.5rem; }

/* ── Contact ──────────────────────────────────────────── */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-2);
}

.contact-card { padding: var(--space-4); }

.contact-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--text-faint);
}

.contact-value {
  font-family: "Sora", sans-serif;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  font-weight: 700;
  text-decoration: none;
  /* Long addresses and IDs must wrap rather than overflow on narrow screens. */
  overflow-wrap: anywhere;
}
.contact-value:hover { text-decoration: underline; }

.contact-meta { font-size: 0.87rem; color: var(--text-dim); }

.contact-meta code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.83rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.12rem 0.45rem;
  overflow-wrap: anywhere;
}

.contact-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: var(--space-2); }

.copy-status {
  margin-top: var(--space-3);
  min-height: 1.4rem;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--text);
}

/* ── Footer ───────────────────────────────────────────── */

.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding-block: var(--space-4);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: space-between;
  align-items: center;
  font-size: 0.89rem;
  color: var(--text-faint);
}

.footer-links { display: flex; gap: var(--space-3); list-style: none; margin: 0; padding: 0; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ── Reveal (only when JS is running) ─────────────────── */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .hero-portrait { order: -1; justify-self: center; }
  .about-grid { grid-template-columns: 1fr; gap: var(--space-4); }

  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile-hero { grid-column: span 2; grid-row: auto; }
  .tile-sm   { grid-column: span 1; }
  .tile-md   { grid-column: span 2; }
}

@media (max-width: 640px) {
  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: var(--space-2) var(--space-3) var(--space-3);
    background: rgba(5, 5, 5, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav-link { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
  .nav-link::after { display: none; }

  .nav-toggle { display: grid; }
  .header-cta { display: none; }

  .bento { grid-template-columns: 1fr; }
  .tile-hero, .tile-sm, .tile-md { grid-column: span 1; }

  .hero-cta .btn { flex: 1 1 100%; }
  .scroll-cue { display: none; }
}

/* ── Motion preferences ───────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js [data-reveal] { opacity: 1; transform: none; }
  .marquee-inner { animation: none; }
  .marquee-group img { opacity: 0.75; }
}
