/*
  styles.css — Freek van Rijn
  ---------------------------------------------------------------
  Edit COLORS and FONTS in §1 only. Layout is grid-based.

    1.  TOKENS
    2.  RESET / BASE
    3.  TYPOGRAPHY
    4.  GRAIN OVERLAY
    5.  LAYOUT (two-column)
    6.  SIDEBAR
    7.  NAV (numbered)
    8.  NOW (live time)
    9.  SOCIALS
    10. CONTENT
    11. CARDS (with number prefix + left-stripe hover)
    12. TAGS (slashed mono)
    13. PLACEHOLDER
    14. REVEAL ANIMATIONS
    15. RESPONSIVE
    16. REDUCED MOTION
*/

/* ── 1. TOKENS ─────────────────────────────────────────────── */
:root {
  /* Warm dark palette — olive charcoal + burnt orange */
  --bg:           #1a1814;
  --bg-card:      #232019;
  --text:         #d6cfbe;
  --text-bright:  #ebe4d2;
  --text-mute:    #8e8676;
  --text-faint:   #5a5246;

  --accent:        #e87d3e;   /* burnt orange */
  --accent-school: #8aa39b;   /* sage — secondary, used for school section */

  --rule: rgba(214, 207, 190, 0.12);

  --font-display: "Fraunces", Georgia, serif;
  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter:      clamp(1.5rem, 4vw, 3rem);
  --content-max: 1280px;
  --measure:     540px;
}

/* ── 2. RESET / BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text-mute);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

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

.skip {
  position: absolute;
  left: 1rem; top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 4px;
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
  z-index: 100;
}
.skip:focus { transform: translateY(0); }

/* ── 3. TYPOGRAPHY ─────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  color: var(--text-bright);
}
p { margin: 0; }

.link {
  color: var(--text-bright);
  font-weight: 500;
  position: relative;
  display: inline-block;
  transition: color 0.15s ease;
}
.link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.link:hover { color: var(--accent); }
.link:hover::after { transform: scaleX(1); }

/* ── 4. GRAIN OVERLAY ──────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'>\
<filter id='n'>\
<feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/>\
<feColorMatrix type='matrix' values='0 0 0 0 0.55  0 0 0 0 0.5  0 0 0 0 0.4  0 0 0 0.45 0'/>\
</filter>\
<rect width='100%' height='100%' filter='url(%23n)'/>\
</svg>");
  background-size: 220px 220px;
}

/* ── 5. LAYOUT ─────────────────────────────────────────────── */
.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

@media (min-width: 1024px) {
  .page {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 4rem;
    padding: 0 clamp(1.5rem, 5vw, 6rem);
  }
}

/* ── 6. SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  padding: 4rem 0 3rem;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    padding: 6rem 0;
    justify-content: space-between;
  }
}

/* Personal mark — tiny label above the name */
.sidebar__mark {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1.4rem;
}
.sidebar__mark .dot { color: var(--accent); margin: 0 0.4em; }

/* Name — display serif italic, the signature voice of the page */
.sidebar__name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.6rem, 4.2vw, 3.6rem);
  letter-spacing: -0.02em;
  color: var(--text-bright);
  line-height: 1.02;
  margin-bottom: 0.9rem;
  font-variation-settings: "opsz" 144;
}
.sidebar__name a { color: inherit; }

.sidebar__role {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1rem;
}

.sidebar__tagline {
  color: var(--text-mute);
  max-width: 24rem;
  margin-bottom: 2.5rem;
  font-size: 0.98rem;
}

/* ── 7. NAV ────────────────────────────────────────────────── */
.sidenav { display: none; }
@media (min-width: 1024px) {
  .sidenav { display: block; }
}
.sidenav ul { list-style: none; padding: 0; margin: 0; }
.sidenav li + li { margin-top: 0.15rem; }

.sidenav a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.45rem 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.sidenav__num {
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: color 0.2s ease;
}
.sidenav__label {
  transition: color 0.2s ease;
}

.sidenav a:hover,
.sidenav a:focus-visible {
  color: var(--text-bright);
  transform: translateX(6px);
}
.sidenav a:hover .sidenav__num,
.sidenav a:focus-visible .sidenav__num {
  color: var(--accent);
}

.sidenav a.is-active {
  color: var(--text-bright);
  transform: translateX(6px);
}
.sidenav a.is-active .sidenav__num { color: var(--accent); }

/* ── 8. NOW (live local time) ──────────────────────────────── */
.now {
  margin-top: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.now__dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.85); }
}
@media (min-width: 1024px) {
  .now { margin-top: auto; padding-top: 2rem; }
}

/* ── 9. SOCIALS ────────────────────────────────────────────── */
.socials {
  list-style: none;
  padding: 0;
  margin: 1.6rem 0 0;
  display: flex;
  gap: 1.2rem;
}
@media (min-width: 1024px) {
  .socials { margin-top: 1.4rem; }
}
.socials a {
  color: var(--text-mute);
  display: inline-flex;
  padding: 0.4rem;
  margin: -0.4rem;
  transition: color 0.2s ease, transform 0.2s ease;
}
.socials a:hover {
  color: var(--accent);
  transform: translateY(-3px);
}
.socials svg { width: 20px; height: 20px; }

/* ── 10. CONTENT ───────────────────────────────────────────── */
.content { padding: 0 0 6rem; }
@media (min-width: 1024px) { .content { padding: 6rem 0; } }

.content__section {
  margin-bottom: 5.5rem;
  scroll-margin-top: 5rem;
}
.content__section:last-of-type { margin-bottom: 0; }

/* Mobile-only section label: " / about " with slash in accent */
.content__sticky-heading {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 calc(var(--gutter) * -1) 1.5rem;
  padding: 0.85rem var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--text-bright);
  font-weight: 500;
}
.content__sticky-heading::before {
  content: "/ ";
  color: var(--accent);
}
.content__section--school .content__sticky-heading::before {
  color: var(--accent-school);
}
@media (min-width: 1024px) {
  .content__sticky-heading { display: none; }
}

.prose {
  max-width: var(--measure);
  color: var(--text);
  font-size: 1.02rem;
}
.prose p + p { margin-top: 1rem; }

.content__footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  color: var(--text-faint);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

/* ── 11. CARDS ─────────────────────────────────────────────── */
.card-list { list-style: none; padding: 0; margin: 0; }
.card-row { margin-bottom: 0.5rem; }

/* Whole row is a single <a> so any part of the card navigates.
   Hover state shows: left accent stripe slides in, title color shifts,
   arrow nudges up-right. */
.card {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.2rem;
  padding: 1.4rem 1.5rem;
  margin: 0 -1.5rem;
  border-radius: 6px;
  color: inherit;
  transition: background 0.25s ease, transform 0.25s ease;
  cursor: pointer;
  overflow: hidden;
}
@media (max-width: 720px) {
  .card {
    grid-template-columns: 1fr;
    padding: 1.2rem 1.25rem;
    margin: 0 -1.25rem;
    gap: 0.4rem;
  }
}

/* Left accent stripe — hidden by default, slides in on hover */
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 1.4rem; bottom: 1.4rem;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.content__section--school .card::before { background: var(--accent-school); }
.card:hover::before,
.card:focus-visible::before {
  transform: scaleY(1);
}

/* Subtle background fill on hover */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border-radius: 6px;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.25s ease;
}
.card:hover::after,
.card:focus-visible::after { opacity: 1; }

/* Number prefix — mono, accent on hover */
.card__number {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding-top: 0.5rem;
  transition: color 0.2s ease;
}
.card:hover .card__number,
.card:focus-visible .card__number { color: var(--accent); }
.content__section--school .card:hover .card__number,
.content__section--school .card:focus-visible .card__number { color: var(--accent-school); }
@media (max-width: 720px) {
  .card__number { padding-top: 0; }
}

.card__body { min-width: 0; }

.card__when {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.6rem;
}
.card__when:empty { display: none; }

.card__title {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.35;
}
.card__title-text { transition: color 0.2s ease; }
.card:hover .card__title-text,
.card:focus-visible .card__title-text { color: var(--accent); }
.content__section--school .card:hover .card__title-text,
.content__section--school .card:focus-visible .card__title-text { color: var(--accent-school); }
.card__sep { color: var(--text-faint); margin: 0 0.15rem; font-weight: 400; }

.card__arrow {
  display: inline-flex;
  width: 14px; height: 14px;
  color: currentColor;
  transition: transform 0.2s ease;
}
.card__arrow svg { width: 100%; height: 100%; }
.card:hover .card__arrow,
.card:focus-visible .card__arrow {
  transform: translate(3px, -3px);
}

.card__desc {
  color: var(--text-mute);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 36rem;
  min-height: 1em;
}

/* ── 12. TAGS — slashed mono text instead of pills ─────────── */
.tags {
  list-style: none;
  padding: 0;
  margin: 0.85rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}
.tags:empty { display: none; }
.tags li { display: inline; }
.tags li:not(:first-child)::before {
  content: " / ";
  color: var(--accent);
  margin: 0 0.55em;
  font-weight: 500;
}
.content__section--school .tags li:not(:first-child)::before {
  color: var(--accent-school);
}

/* ── 13. PLACEHOLDER ───────────────────────────────────────── */
.placeholder {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding: 0.15em 0.55em;
  border: 1px dashed var(--accent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  display: inline-block;
  vertical-align: middle;
}

/* ── 14. REVEAL ANIMATIONS ─────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ── 15. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1023px) {
  .sidebar { padding: 3.5rem 0 2rem; }
  .sidebar__tagline { margin-bottom: 1rem; }
  .content { padding-top: 0; }
}
@media (max-width: 540px) {
  .sidebar { padding: 2.5rem 0 1.5rem; }
  .card { padding: 1rem; margin: 0 -1rem; }
}

/* ── 16. REDUCED MOTION ────────────────────────────────────── */
@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;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .now__dot { animation: none; }
}
