/* ademartutor.com v2 — restrained research-portfolio system
   Type: Newsreader (serif), IBM Plex Mono (mono), Inter (sans-fallback)
   Inspired by shikun.io / Clarity template aesthetic */

:root {
  /* ——— light theme defaults (override-able by Tweaks) ——— */
  --paper: oklch(0.985 0.003 90);
  --paper-2: oklch(0.965 0.004 90);
  --rule: oklch(0.88 0.005 90);
  --ink: oklch(0.18 0.012 250);
  --ink-2: oklch(0.32 0.012 250);
  --muted: oklch(0.45 0.012 250);
  --faint: oklch(0.7 0.008 250);
  --accent: oklch(0.58 0.12 35);
  --accent-soft: oklch(0.92 0.04 35);

  --serif: "Newsreader", "Charter", "Iowan Old Style", Georgia, serif;
  --mono:  "IBM Plex Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
  --sans:  "Inter", system-ui, -apple-system, "Helvetica Neue", sans-serif;

  --measure: 680px;
  --rail-w: 200px;

  /* density */
  --pad-y: 6rem;
  --gap: 3.5rem;
  --line: 1.6;

  --t-fast: 140ms cubic-bezier(.2,.6,.2,1);
  --t-med:  260ms cubic-bezier(.2,.6,.2,1);
}

/* ——— dark ——— */
:root[data-theme="dark"] {
  --paper: oklch(0.16 0.01 250);
  --paper-2: oklch(0.205 0.012 250);
  --rule: oklch(0.3 0.012 250);
  --ink: oklch(0.96 0.005 90);
  --ink-2: oklch(0.85 0.005 90);
  --muted: oklch(0.65 0.01 250);
  --faint: oklch(0.45 0.012 250);
  --accent-soft: oklch(0.32 0.06 35);
}

/* ——— compact density ——— */
:root[data-density="compact"] {
  --pad-y: 4rem;
  --gap: 2.25rem;
  --line: 1.5;
}

/* ——— body font: serif vs sans ——— */
:root[data-body="sans"] body {
  font-family: var(--sans);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  z-index: 100;
  transform: translateY(-150%);
  transition: transform var(--t-fast);
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: var(--line);
  font-feature-settings: "ss01", "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-med), color var(--t-med);
}

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

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
  transition: color var(--t-fast), border-color var(--t-fast);
}
a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ——— layout shell ——— */
.shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ——— top nav ——— */
.nav {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}
.nav-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.05rem 0;
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: -0.005em;
}
.nav-name {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  font-weight: 500;
  border-bottom: none;
  color: var(--ink);
}
.nav-name .sigil {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-1px);
}
.nav-name:hover { color: var(--ink); }
.nav-links {
  display: flex;
  gap: 1.6rem;
  align-items: baseline;
}
.nav-links a {
  border-bottom: none;
  color: var(--muted);
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1.07rem;
  height: 1px;
  background: var(--ink);
}

/* ——— hero / page header ——— */
.page-head {
  padding-top: var(--pad-y);
  padding-bottom: calc(var(--pad-y) * 0.55);
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.2rem;
}
.eyebrow .dot {
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 0.5rem;
  transform: translateY(-2px);
}
h1.display, .display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.022em;
  margin: 0 0 1.6rem;
  text-wrap: balance;
}
.lede {
  max-width: var(--measure);
  font-size: clamp(1.05rem, 1.5vw, 1.18rem);
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}
.lede em {
  font-style: italic;
  color: var(--muted);
}

/* ——— sections / rail layout ——— */
.section {
  padding: var(--gap) 0;
  border-top: 1px solid var(--rule);
}
.section:first-of-type { border-top: 1px solid var(--rule); }

.rail {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 760px) {
  .rail { grid-template-columns: 1fr; gap: 0.6rem; }
}

.rail-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.45rem;
  position: sticky;
  top: 5rem;
}
@media (max-width: 760px) {
  .rail-label { position: static; padding-top: 0; padding-bottom: 0.4rem; }
}
.rail-label .num {
  display: block;
  color: var(--faint);
  font-size: 11px;
  margin-bottom: 0.2rem;
}

.rail-body { max-width: var(--measure); }
.rail-body p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}
.rail-body p:last-child { margin-bottom: 0; }

.section-h {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.15;
  letter-spacing: -0.018em;
  margin: 0 0 1.4rem;
}

/* ——— project list (hoverable rows) ——— */
.proj-list { list-style: none; margin: 0; padding: 0; }
.proj-row {
  display: grid;
  grid-template-columns: 1fr;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
  cursor: default;
}
.proj-row:first-child { border-top: 1px solid var(--rule); }

.proj-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}
.proj-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: -0.012em;
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.7rem;
  transition: color var(--t-fast);
}
.proj-title .arrow {
  font-family: var(--mono);
  font-size: 0.78em;
  color: var(--faint);
  transform: translateX(-3px);
  opacity: 0;
  transition: transform var(--t-med), opacity var(--t-med), color var(--t-fast);
}
.proj-row:hover .proj-title { color: var(--accent); }
.proj-row:hover .proj-title .arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}
.proj-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
  transition: color var(--t-fast);
}
.proj-row:hover .proj-meta { color: var(--muted); }

.proj-summary {
  margin: 0.7rem 0 0;
  color: var(--ink-2);
  max-width: var(--measure);
  text-wrap: pretty;
}

.proj-detail {
  display: grid;
  grid-template-columns: 1fr;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height var(--t-med), opacity var(--t-med), margin-top var(--t-med);
  margin-top: 0;
}
.proj-row:hover .proj-detail,
.proj-row:focus-within .proj-detail {
  max-height: 600px;
  opacity: 1;
  margin-top: 1rem;
}
.proj-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  border-left: 1px solid var(--rule);
  padding-left: 1rem;
}
.proj-bullets li { margin: 0 0 0.25rem; }
.proj-bullets li::before {
  content: "—  ";
  color: var(--faint);
}
.proj-links {
  margin-top: 0.9rem;
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.proj-links a {
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule);
}
.proj-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ——— card variant (alternate projects layout) ——— */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (max-width: 720px) {
  .proj-grid { grid-template-columns: 1fr; }
}
.proj-card {
  background: var(--paper);
  padding: 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: background var(--t-fast);
}
.proj-card:hover { background: var(--paper-2); }
.proj-card .proj-title { font-size: 1.2rem; }
.proj-card .proj-summary { margin-top: 0; font-size: 0.95rem; }

/* hide alternate layouts by default */
[data-projlayout="list"] .proj-grid { display: none; }
[data-projlayout="cards"] .proj-list { display: none; }
[data-projlayout="cards"] .proj-grid { display: grid; }

/* ——— work timeline rows (about) ——— */
.work-row {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: 2.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}
.work-row:last-child { border-bottom: 1px solid var(--rule); }
@media (max-width: 760px) {
  .work-row { grid-template-columns: 1fr; gap: 0.4rem; }
}
.work-meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.4rem;
}
.work-meta .role { display: block; color: var(--ink-2); margin-top: 0.2rem; text-transform: none; letter-spacing: 0; }
.work-body h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.2rem;
  margin: 0 0 0.6rem;
  letter-spacing: -0.012em;
}
.work-body p { margin: 0 0 0.7rem; max-width: var(--measure); }
.work-body p:last-child { margin-bottom: 0; }

/* ——— gallery (about) ——— */
.gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 1.4rem 0 0;
}
@media (max-width: 720px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
.gallery figure {
  margin: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9);
  transition: filter var(--t-med), transform var(--t-med);
}
.gallery figure:hover img { filter: saturate(1); transform: scale(1.03); }

/* ——— inline strong / em ——— */
strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; color: var(--ink-2); }

/* ——— footer ——— */
.footer {
  margin-top: var(--pad-y);
  padding: 2.4rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer a { border-bottom: none; color: var(--ink-2); }
.footer a:hover { color: var(--accent); }
.footer .left { display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* ——— small helpers ——— */
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.kbd {
  font-family: var(--mono);
  font-size: 11.5px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--muted);
}

/* ——— signature ——— */
.sig {
  font-family: "Caveat", cursive;
  font-weight: 500;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  opacity: 0.85;
  letter-spacing: 0.01em;
}
:root[data-theme="dark"] .sig { opacity: 0.9; }

/* ——— inline ascii diagram ——— */
.diagram {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre;
  margin: 1.4rem 0 0;
  padding: 1rem 1.2rem;
  border-left: 2px solid var(--rule);
  background: var(--paper-2);
  overflow-x: auto;
}

/* ——— figure image ——— */
.figure-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.4rem 0 0;
  border: 1px solid var(--rule);
  background: var(--paper-2);
}

/* ——— call out ——— */
.callout {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-2);
  border-left: 2px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1rem;
  margin: 1.4rem 0;
  max-width: var(--measure);
}

/* hover: hero accent dot pulse */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 0.45rem;
  animation: pulse 2.4s ease-in-out infinite;
}

/* contact block */
.contact {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}
.contact a { color: var(--ink); border-bottom: 1px solid var(--rule); }
.contact a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.contact .sep { color: var(--faint); }

/* utility */
.stack > * + * { margin-top: 1rem; }

/* video modal */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
}
.video-modal[hidden] { display: none; }
.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.video-modal__frame {
  position: relative;
  width: min(1100px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.video-modal__player,
.video-modal__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-modal__close:hover { background: rgba(0, 0, 0, 0.85); }
body.video-modal-open { overflow: hidden; }

#at-consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  max-width: 720px;
  margin: 0 auto;
}
.at-consent__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.2rem;
  align-items: center;
  padding: 0.95rem 1.1rem;
}
.at-consent__text {
  margin: 0;
  flex: 1 1 320px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.at-consent__text a { color: inherit; }
.at-consent__actions {
  display: flex;
  gap: 0.5rem;
  flex: 0 0 auto;
}
.at-consent__btn {
  font: inherit;
  font-size: 13px;
  padding: 0.5rem 0.95rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.at-consent__btn--reject:hover { border-color: var(--ink-2); }
.at-consent__btn--accept {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.at-consent__btn--accept:hover { background: var(--accent); border-color: var(--accent); }
@media (max-width: 540px) {
  .at-consent__actions { width: 100%; justify-content: flex-end; }
}
