/* Live homepage stylesheet: Trail design, burgundy accent. */

:root {
  color-scheme: light;
  --paper: #f7f4ee;
  --ink: #18212b;
  --muted: #5f6670;
  --line: #e2ddd3;
  --line-strong: #c9c2b5;
  --pane: #1c2a38;
  --pane-ink: #f1ebdf;
  --pane-muted: #a9b2bc;
  --pane-line: rgba(241, 235, 223, 0.16);
  --focus: #1b56c6;

  /* Accent: --accent sits on the paper, --accent-pane on the navy pane.
     Default is sage; data-accent on <html> picks a variant. */
  --accent: #4a6652;
  --accent-pane: #a8c4ad;
  --accent-wash: #dfe7df;

  --display: "Segoe UI Variable Display", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Charter, "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;

  /* Portrait slot colours. */
  --app-research: #e9e4da;
  --app-merchant: #ffffff;
  --tile-border: rgba(23, 22, 15, 0.12);
  --tile-ink: #26231d;
  --shadow: 0 1px 2px rgba(23, 22, 15, 0.08), 0 6px 18px rgba(23, 22, 15, 0.10);
}

[data-accent="dusty-blue"] {
  --accent: #43607c;
  --accent-pane: #a9c0d8;
  --accent-wash: #dde5ee;
}

[data-accent="burgundy"] {
  --accent: #7a2b3a;
  --accent-pane: #dba5b0;
  --accent-wash: #eedde0;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1;
  overflow-x: hidden;
}

::selection {
  background: var(--accent-wash);
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.identity :focus-visible {
  outline-color: #9cc0ff;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Two-pane composition: a fixed identity pane and a scrolling page */

.layout {
  display: grid;
  grid-template-columns: minmax(19rem, 34%) minmax(0, 1fr);
  min-height: 100vh;
}

.identity {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  height: 100vh;
  height: 100svh;
  padding: clamp(2.5rem, 7vh, 4.5rem) clamp(2rem, 4vw, 3.75rem);
  background: var(--pane);
  color: var(--pane-ink);
  overflow: auto;
}

.identity-top {
  display: grid;
  gap: 1.5rem;
}

.name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.75rem, 1.8rem + 2.6vw, 4.25rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.role {
  margin: 0;
  max-width: 17rem;
  color: var(--pane-muted);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.index-label {
  margin: 0 0 0.75rem;
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pane-muted);
}

.index ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--pane-line);
}

.index li {
  border-bottom: 1px solid var(--pane-line);
}

.index a {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 120ms;
}

.index a span {
  font-variant-numeric: tabular-nums;
  color: var(--accent-pane);
}

.index a:hover {
  color: #ffffff;
}

.merchant {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--pane-line);
  text-decoration: none;
}

.merchant-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.7rem;
  background: #ffffff;
}

.merchant-mark img {
  width: 64%;
  height: 64%;
}

.merchant-text {
  display: grid;
  min-width: 0;
  font-family: var(--sans);
  line-height: 1.3;
}

.merchant-name {
  font-weight: 600;
}

.merchant-url {
  font-size: 0.8125rem;
  color: var(--pane-muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

.merchant:hover .merchant-url {
  text-decoration-color: currentColor;
}

/* Page column */

.page {
  min-width: 0;
  padding: clamp(3.5rem, 11vh, 7rem) clamp(2rem, 7vw, 7rem) 4rem;
}

.page:focus {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The trail: numbered sections joined by one vertical thread */

.trail {
  --gutter: 4.25rem;
  position: relative;
  list-style: none;
  max-width: 42rem;
  margin: 0;
  padding: 0 0 0 var(--gutter);
}

.trail::before {
  content: "";
  position: absolute;
  top: 1.1rem;
  bottom: 1.5rem;
  left: 1.1rem;
  border-left: 1.5px dashed var(--line-strong);
}

.station {
  position: relative;
  min-width: 0;
  padding-bottom: clamp(3.5rem, 9vh, 5.5rem);
}

.station:last-child {
  padding-bottom: 0.5rem;
}

.station-step {
  margin: 0 0 1.1rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.node {
  position: absolute;
  left: calc(-1 * var(--gutter));
  top: -0.35rem;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.75rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.station--first .node {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

/* About */

.lead {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-size: clamp(2.5rem, 1.8rem + 2vw, 3.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
  overflow-wrap: break-word;
}

.bio {
  max-width: 33rem;
  font-size: 1.1875rem;
  line-height: 1.6;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.bio p {
  margin: 0 0 0.9rem;
}

.bio p:last-child {
  margin-bottom: 0;
}

/* Writing & Research */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.row {
  padding: 1.4rem 0 1.5rem;
}

.row-kind {
  margin: 0 0 0.45rem;
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.row-title {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.15;
  overflow-wrap: break-word;
}

.row-title cite {
  font-style: italic;
}

.row-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  margin: 1.1rem 0 0;
}

/* Pending article: a quiet dashed label, not a control. */
.primary {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}

/* Set by home.js once a verified article URL is configured. */
.primary--live {
  border: 1px solid var(--pane);
  background: var(--pane);
  color: var(--pane-ink);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 120ms, border-color 120ms;
}

.primary--live:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.go {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
}

.go::after {
  content: "→";
  transition: transform 120ms;
}

.go:hover::after {
  transform: translateX(3px);
}

/* Elsewhere */

.links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
}

.site {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.social-icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
  color: var(--accent);
}

.site:hover .social-icon,
.site:focus-visible .social-icon {
  color: var(--pane);
}

a.site {
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.22em;
}

.pending {
  color: var(--muted);
  font-size: 0.75rem;
}

.nobr {
  white-space: nowrap;
}

/* The asset itself is portrait-only. The full original is not served. */

.portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: 6.5rem;
  height: 6.5rem;
  margin: 0.25rem auto 1.25rem;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, var(--app-research), var(--app-merchant));
  border: 1px solid var(--tile-border);
  box-shadow: var(--shadow);
}

.portrait-initials {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--tile-ink);
}

.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The slot is shaped as an arch inside the identity pane. */
.identity .portrait {
  width: 7.5rem;
  height: auto;
  aspect-ratio: 210 / 290;
  margin: 0;
  border-radius: 999px 999px 0.75rem 0.75rem;
  border-color: rgba(241, 235, 223, 0.35);
  box-shadow: none;
}

/* Narrow screens: one stacked column with a compact identity panel. */

@media (max-width: 860px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .identity {
    position: static;
    height: auto;
    min-height: 0;
    gap: 1.5rem;
    padding: 2rem 1.25rem;
    overflow: visible;
  }

  .identity-top {
    gap: 1rem;
  }

  .identity .portrait {
    width: 5.5rem;
    height: auto;
    aspect-ratio: 210 / 290;
  }

  .portrait-initials {
    font-size: 1.6rem;
  }

  .merchant {
    margin-top: 0;
  }

  .page {
    padding: 2.5rem 1.25rem 3rem;
  }

  .trail {
    --gutter: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media (forced-colors: active) {
  .identity {
    border-right: 1px solid CanvasText;
  }
  .node,
  .portrait,
  .merchant-mark {
    border: 1px solid CanvasText;
  }
}
