/* ═══════════════════════════════════════════════
   RADKISSON.XYZ — Design System v2
   Espectro DNA: dark, textured, editorial.
   Hand-written CSS. No Tailwind dependency for layout.
   ═══════════════════════════════════════════════ */

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

:root {
  /* Palette — researcher gothic: white paper, black ink, electric violet */
  --ink: #0a0a0f;
  --ink-soft: #3a3a48;
  --ink-dim: #75758a;
  --rule: #d0d0d8;
  --rule-soft: #e6e6ec;
  --paper: #fafaf8;
  --surface: rgba(250, 250, 248, 0.72);
  --overlay: rgba(250, 250, 248, 0.88);
  --oxide: #3d2eff;
  --oxide-dim: rgba(61, 46, 255, 0.3);

  /* Typography */
  --serif: 'Instrument Serif', 'Newsreader', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* Type scale (base 20px) */
  --t-display: 52px;
  --t-display-sm: 38px;
  --t-sub: 24px;
  --t-sub-sm: 20px;
  --t-body: 19px;
  --t-body-sm: 17px;
  --t-mono: 15px;
  --t-mono-sm: 14px;
  --t-label: 13px;
  --t-micro: 12px;

  /* Spacing scale (8px base) */
  --s0: 4px;
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 64px;
  --s7: 80px;
  --s8: 96px;

  /* Sidebar */
  --sidebar-w: 280px;
}

html {
  font-size: 20px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--body);
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  min-height: 100vh;
}

.layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%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");
}

body > * { position: relative; z-index: 1; }
::selection { background: var(--oxide); color: var(--paper); }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  padding: var(--s5) var(--s3) var(--s3);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: transparent;
  font-family: var(--mono);
  z-index: 10;
}

.sidebar .brand {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 400;
  margin-bottom: var(--s0);
  color: var(--ink);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: block;
}
.sidebar .brand .oxide { color: var(--oxide); }

.sidebar .brand-sub {
  font-family: var(--mono);
  font-size: var(--t-label);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
  margin-bottom: var(--s5);
  opacity: 0.7;
}

.sidebar .nav-section {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.sidebar .nav-link {
  font-family: var(--mono);
  font-size: var(--t-mono);
  color: var(--ink-soft);
  text-decoration: none;
  padding: var(--s1) var(--s1);
  border-radius: 4px;
  transition: all 0.15s;
  display: flex;
  align-items: baseline;
  gap: var(--s2);
}

.sidebar .nav-link:hover {
  background: rgba(10, 10, 15, 0.04);
  color: var(--ink);
}

.sidebar .nav-link.active {
  color: var(--oxide);
  background: rgba(10, 10, 15, 0.03);
  border-left: 2px solid var(--oxide);
  padding-left: calc(var(--s1) - 2px);
}

.sidebar .nav-link .num {
  font-size: var(--t-micro);
  color: var(--ink-dim);
  opacity: 0.5;
  min-width: 32px;
}

.sidebar .nav-divider {
  height: 1px;
  background: var(--rule);
  margin: var(--s3) 0;
}

.sidebar .meta {
  margin-top: auto;
  padding-top: var(--s3);
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: var(--t-micro);
  color: var(--ink-dim);
  opacity: 0.7;
  line-height: 1.6;
}

.sidebar .meta a {
  color: var(--ink-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sidebar .meta a:hover { color: var(--oxide); }

/* ── MAIN CONTENT ── */
.main {
  flex: 1;
  padding: var(--s5) var(--s6) var(--s7);
  max-width: 760px;
  min-height: 100vh;
  background: transparent;
}

/* ── EXHIBIT / SECTION ── */
.exhibit {
  margin-bottom: var(--s7);
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--s7);
  scroll-margin-top: 80px;
}
.exhibit:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: var(--s4);
}

.exhibit .cat {
  font-family: var(--mono);
  font-size: var(--t-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--oxide);
  margin-bottom: var(--s2);
}

.exhibit h1,
.exhibit h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--ink);
}

.exhibit h1 { font-size: var(--t-display); margin-bottom: var(--s1); }
.exhibit h2 { font-size: var(--t-display-sm); margin-bottom: var(--s1); }

.exhibit .sub {
  font-family: var(--serif);
  font-size: var(--t-sub);
  color: var(--ink-soft);
  margin-bottom: var(--s4);
  font-style: italic;
  line-height: 1.3;
}

.exhibit p {
  font-size: var(--t-body);
  margin-bottom: var(--s3);
  max-width: 60ch;
  color: var(--ink);
  line-height: 1.6;
}

.exhibit p strong { color: var(--ink); font-weight: 600; }

.exhibit a {
  color: var(--oxide);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.exhibit a:hover {
  color: var(--ink);
  border-bottom-color: var(--oxide);
}

/* Accent variants */
.exhibit--oxide {
  border-left: 2px solid var(--oxide);
  padding-left: var(--s3);
}
.exhibit--hairline {
  border-left: 1px solid var(--rule);
  padding-left: var(--s3);
}

/* ── METADATA CARD ── */
.meta-card {
  margin-top: var(--s4);
  border: 1px solid var(--rule);
  padding: var(--s3) var(--s4);
  font-family: var(--mono);
  font-size: var(--t-mono);
  color: var(--ink-soft);
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: var(--s1) var(--s3);
  line-height: 1.5;
}
.meta-card dt {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--t-mono-sm);
  color: var(--ink-dim);
  font-weight: 600;
  opacity: 0.65;
}
.meta-card dd { color: var(--ink); }

/* ── BUTTONS / TRIGGERS ── */
.btn {
  font-family: var(--mono);
  font-size: var(--t-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--s1) var(--s3);
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.btn:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn--oxide {
  border-color: var(--oxide);
  color: var(--oxide);
}
.btn--oxide:hover {
  background: var(--oxide);
  color: var(--paper);
}

/* ── TIMELINE ── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline-row {
  display: block;
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--rule-soft);
}
.timeline-row .yr {
  display: block;
  margin-bottom: var(--s1);
}
.timeline-row:first-child { border-top: 1px solid var(--rule); }
.timeline-row:last-child { border-bottom: none; }
.timeline-row .yr { color: var(--oxide); font-weight: 500; }
.timeline-row .desc { color: var(--ink); }

/* ── FORM ── */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  max-width: 540px;
  margin-top: var(--s3);
}
.form label {
  display: flex;
  flex-direction: column;
  gap: var(--s0);
  font-family: var(--mono);
  font-size: var(--t-mono-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.form input, .form select, .form textarea {
  font-family: var(--body);
  font-size: var(--t-body);
  padding: var(--s1) var(--s2);
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  border-radius: 0;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid var(--oxide);
  outline-offset: 0;
  border-color: var(--oxide);
}
.form textarea { resize: vertical; min-height: 100px; }
.form button {
  align-self: flex-start;
  margin-top: var(--s1);
  font-family: var(--mono);
  font-size: var(--t-mono-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: var(--s1) var(--s3);
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}
.form button:hover {
  background: var(--oxide);
  border-color: var(--oxide);
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* ── END REGISTER ── */
.end-register {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) 0 var(--s5);
  font-family: var(--mono);
  font-size: var(--t-label);
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.5;
}
.end-register::before, .end-register::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ── SITE FOOTER ── */
.site-footer {
  margin-top: var(--s7);
  padding: var(--s5) 0 var(--s6);
  border-top: 1px solid var(--rule);
  text-align: center;
  font-family: var(--mono);
  font-size: var(--t-label);
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}
.site-footer a {
  color: var(--ink-dim);
  text-decoration: none;
  font-weight: 500;
}
.site-footer a:hover { color: var(--oxide); }

/* ── TOP NAV (for pages without sidebar: about, journal) ── */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s2) var(--s4);
}
.topnav .brand-small {
  font-family: var(--mono);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--oxide);
  text-decoration: none;
}
.topnav .topnav-links {
  display: flex;
  gap: var(--s3);
  font-family: var(--mono);
  font-size: var(--t-label);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.topnav .topnav-links a,
.topnav .topnav-links span {
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.topnav .topnav-links a:hover { color: var(--oxide); }
.topnav .topnav-links span.current { color: var(--ink-dim); opacity: 0.4; }

/* Pages with topnav get extra top padding */
.page-topnav .main {
  padding-top: var(--s7);
  margin: 0 auto;
}

/* ── WHAT I DO (homepage service list) ── */
.service-list {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}
.service-item {
  font-family: var(--serif);
  font-size: var(--t-sub);
  color: var(--ink);
  text-decoration: none;
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--rule-soft);
  transition: color 0.15s;
  display: flex;
  align-items: baseline;
  gap: var(--s2);
}
.service-item .label { flex: 1; }
.service-item .desc {
  font-family: var(--body);
  font-size: var(--t-mono-sm);
  color: var(--ink-dim);
  font-weight: 400;
  text-align: right;
  white-space: normal;
  display: none;
}
@media (min-width: 769px) {
  .service-item .desc { display: block; }
}
.service-item:hover { color: var(--oxide); }
.service-item .arrow {
  font-family: var(--mono);
  font-size: var(--t-mono-sm);
  color: var(--ink-dim);
}
.service-item:hover .arrow { color: var(--oxide); }

/* ── NOW BLOCK ── */
.now-block {
  font-family: var(--body);
  font-size: var(--t-body);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 60ch;
}

/* ── LATEST ENTRIES ── */
.latest-item {
  display: block;
  border-bottom: 1px solid var(--rule-soft);
  padding: var(--s1) 0;
  text-decoration: none;
}
.latest-item .date {
  font-family: var(--mono);
  font-size: var(--t-micro);
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.latest-item .title {
  font-family: var(--serif);
  font-size: var(--t-body);
  color: var(--ink);
  transition: color 0.15s;
}
.latest-item:hover .title { color: var(--oxide); }

/* ── PROOF SECTION (services) ── */
.proof-section {
  margin-top: var(--s3);
  padding-top: var(--s2);
  border-top: 1px dashed var(--rule);
}
.proof-section .proof-label {
  font-family: var(--mono);
  font-size: var(--t-micro);
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--s1);
}

/* ── TABLET (769px–1024px) ── */
@media (max-width: 1024px) {
  .main {
    padding: var(--s5) var(--s4) var(--s6);
  }
  .exhibit { margin-bottom: var(--s6); padding-bottom: var(--s6); }
}

/* ── MOBILE (≤768px) ── */
@media (max-width: 768px) {
  :root {
    --t-display: 40px;
    --t-display-sm: 32px;
    --t-sub: 20px;
    --t-sub-sm: 18px;
    --t-body: 17px;
    --t-body-sm: 16px;
    --t-mono: 14px;
    --t-mono-sm: 13px;
    --t-label: 12px;
    --t-micro: 11px;
    --sidebar-w: 100%;
  }

  html { font-size: 18px; }

  body { display: block; }

  .layout { display: block; }

  /* Sidebar becomes a clean sticky header bar */
  .sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--paper);
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: var(--s2) var(--s3);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--s2);
    overflow: visible;
  }
  .sidebar .brand {
    font-size: 28px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .sidebar .brand-sub { display: none; }
  .sidebar .meta { display: none; }
  .sidebar .nav-divider { display: none; }

  /* Nav links: horizontal, right-aligned, no scroll */
  .sidebar .nav-section {
    flex-direction: row;
    gap: 0;
    align-items: center;
  }
  .sidebar .nav-link {
    font-size: var(--t-micro);
    padding: var(--s1) var(--s2);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }
  .sidebar .nav-link .num { display: none; }
  .sidebar .nav-link.active {
    border-left: none;
    border-radius: 4px;
    background: var(--rule);
    color: var(--oxide);
  }

  /* The Español link goes inline too */
  .sidebar > .nav-link:not(.active) {
    font-size: var(--t-micro);
    padding: var(--s1) var(--s2);
  }

  /* Main content */
  .main {
    padding: var(--s4) var(--s3) var(--s6);
    max-width: 100%;
    background: var(--paper);
  }

  .exhibit {
    margin-bottom: var(--s5);
    padding-bottom: var(--s5);
  }
  .exhibit--oxide { padding-left: var(--s2); }
  .exhibit--hairline { padding-left: var(--s2); }

  .exhibit .sub { font-size: var(--t-sub-sm); margin-bottom: var(--s3); }
  .exhibit p { font-size: var(--t-body-sm); max-width: 100%; }

  /* Responsive images */
  .exhibit img {
    max-width: 200px !important;
    width: 200px !important;
    height: auto;
  }

  /* Service items: smaller, tighter */
  .service-item {
    font-size: var(--t-body);
    padding: var(--s1) 0;
  }

  /* Timeline: already stacked, tighten padding */
  .timeline-row {
    padding: var(--s2) 0;
  }
  .timeline-row .desc { font-size: var(--t-mono-sm); }

  /* Meta card: single column on very small screens */
  .meta-card {
    grid-template-columns: 100px 1fr;
    padding: var(--s2) var(--s3);
    gap: var(--s1) var(--s2);
    font-size: var(--t-mono-sm);
  }
  .meta-card dt { font-size: var(--t-micro); }

  /* Form: full width, bigger tap targets */
  .form { max-width: 100%; gap: var(--s2); }
  .form label { font-size: var(--t-micro); gap: 2px; }
  .form input, .form select, .form textarea {
    font-size: 16px; /* prevents iOS auto-zoom */
    padding: var(--s2) var(--s2);
    min-height: 44px; /* Apple HIG tap target */
  }
  .form select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23d5cfc7' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
  }
  .form button {
    min-height: 44px;
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Buttons: bigger tap targets */
  .btn {
    min-height: 40px;
    padding: var(--s1) var(--s4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Topnav (about/journal pages) */
  .topnav {
    padding: var(--s2) var(--s3);
    flex-wrap: wrap;
    gap: var(--s1);
  }
  .topnav .brand-small { font-size: var(--t-mono-sm); }
  .topnav .topnav-links {
    gap: var(--s1);
    font-size: var(--t-micro);
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .page-topnav .main { padding-top: var(--s6); }

  /* Footer: smaller, less padding */
  .site-footer {
    font-size: var(--t-micro);
    padding: var(--s4) var(--s3) var(--s5);
    line-height: 1.8;
  }

  /* End register: tighter */
  .end-register {
    padding: var(--s1) 0 var(--s3);
    font-size: var(--t-micro);
  }
}

/* ── SMALL PHONES (≤400px) ── */
@media (max-width: 400px) {
  :root {
    --t-display: 32px;
    --t-display-sm: 26px;
    --t-sub: 18px;
    --t-body: 16px;
  }

  html { font-size: 17px; }

  .sidebar {
    padding: var(--s1) var(--s2);
  }
  .sidebar .brand { font-size: 24px; }
  .sidebar .nav-link {
    padding: var(--s0) var(--s1);
    font-size: 10px;
    letter-spacing: 0.05em;
  }

  .main { padding: var(--s3) var(--s2) var(--s5); }

  .exhibit { margin-bottom: var(--s4); padding-bottom: var(--s4); }

  .exhibit img {
    max-width: 160px !important;
    width: 160px !important;
  }

  .form input, .form select, .form textarea {
    padding: var(--s1) var(--s2);
  }

  .topnav .topnav-links { gap: var(--s0); }
  .topnav .topnav-links a, .topnav .topnav-links span {
    font-size: 10px;
  }
}

/* ── MOBILE MENU (fallback for sidebar nav) ── */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  padding: var(--s1);
  height: 40px;
  width: 40px;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.menu-toggle:hover {
  color: var(--oxide);
}
.menu-toggle svg {
  width: 22px;
  height: 22px;
}

.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(250, 250, 248, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.menu-overlay.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}
.menu-overlay a {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s;
}
.menu-overlay a:hover { color: var(--oxide); }
.menu-overlay .menu-close {
  position: absolute;
  top: var(--s3);
  right: var(--s4);
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-size: 24px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-overlay .menu-close:hover { color: var(--oxide); }
.menu-overlay .menu-lang {
  position: absolute;
  bottom: var(--s6);
  font-family: var(--mono);
  font-size: var(--t-label);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
}
.menu-overlay .menu-lang a { font-size: var(--t-label); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.15em; }

@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; }
  /* Hide inline nav on mobile, use overlay instead */
  .sidebar .nav-section { display: none; }
  .sidebar > .nav-link { display: none; }
}