/* ============================================================
   Chamfer Advisory — Design System v2.0
   Technical Monograph UI Reference
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,200..800;1,6..72,200..800&family=Noto+Sans:wght@400;500;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Custom Properties ────────────────────────────────────── */
:root {
  --paper:      #F9F9F8;
  --ink:        #121212;
  --ink-mid:    #3A3A3A;
  --ink-mute:   #8C8C8C;
  --accent:     #FFD700;
  --surface:    #EBEBE9;

  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans:  'Noto Sans', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'Courier New', monospace;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 280ms ease;
}

body.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  body { opacity: 1; transition: none; }
}

a {
  color: inherit;
}

ul {
  list-style: none;
}

/* ── Typography Utilities ─────────────────────────────────── */

/* The Voice — editorial serif */
.voice {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* The Voice Display — large, italic, light */
.voice-display {
  font-family: var(--font-serif);
  font-weight: 200;
  font-style: italic;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

/* The System — geometric sans */
.system {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
}

/* The Proof — monospace label */
.proof {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Layout ───────────────────────────────────────────────── */

.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 7/5 column split */
.page-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 4rem;
  align-items: start;
}

.aside-col {
  padding-left: 3rem;
  border-left: 1px solid var(--surface);
}

/* Body text in main columns */
.body-text {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ink-mid);
  margin-bottom: 1.5rem;
}

.body-text:last-child {
  margin-bottom: 0;
}

/* ── Page-Specific Layouts ────────────────────────────────── */

/* index.html — hero section (full viewport, bottom-anchored) */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4rem 3rem;
  position: relative;
  border-bottom: 1px solid var(--surface);
}

/* index.html — about/bio section */
.about-section {
  padding: 5rem 3rem;
}

/* work.html — flex layout with vertical label rail */
.work-page {
  display: flex;
  flex: 1;
  min-height: 100vh;
}

.work-label-rail {
  width: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--surface);
  padding: 4rem 0;
}

.work-content {
  flex: 1;
  padding: 5rem 4rem;
}

/* value.html — full-width sections */
.value-hero {
  padding: 5rem 3rem 3rem;
  border-bottom: 1px solid var(--surface);
}

.value-body {
  padding: 4rem 3rem;
}

.phase-section {
  padding: 4rem 3rem 6rem;
}

/* future.html — single-viewport statement */
.future-main {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 3rem;
  position: relative;
}

.future-body {
  padding: 4rem 3rem;
}

/* contact.html — terminal layout (bottom-right anchored) */
.contact-main {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 4rem 3rem;
  text-align: right;
}

/* ── Navigation ───────────────────────────────────────────── */

/* Logo-only header (index.html) */
.page-header {
  padding: 2rem 3rem;
  border-bottom: 1px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink);
  text-decoration: none;
}

/* Top nav bar (value.html) */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 3rem;
  border-bottom: 1px solid var(--surface);
}

.top-nav-logo {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink);
  text-decoration: none;
}

.top-nav-links {
  display: flex;
  gap: 2.5rem;
}

.top-nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  text-decoration: none;
  padding-bottom: 2px;
  transition: color 300ms ease;
}

.top-nav-links a:hover {
  color: var(--ink);
}

.top-nav-links a.active {
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
}

/* ── Vertical Section Label ───────────────────────────────── */
.section-label-vertical {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  white-space: nowrap;
}

/* ── Inline Section Label ─────────────────────────────────── */
.section-label-inline {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  margin-bottom: 2rem;
}

/* ── Background Anchor ────────────────────────────────────── */
.bg-anchor {
  position: absolute;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 200;
  font-size: 160px;
  color: var(--surface);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* ── Animation: The Curtain Rise (page entrance) ─────────── */
.curtain-rise {
  opacity: 0;
  transform: translateY(10px);
}

.curtain-rise.visible {
  animation: curtainRise 1.2s ease-out both;
}

.curtain-rise[data-delay="1"].visible { animation-delay: 0.2s; }
.curtain-rise[data-delay="2"].visible { animation-delay: 0.4s; }
.curtain-rise[data-delay="3"].visible { animation-delay: 0.6s; }
.curtain-rise[data-delay="4"].visible { animation-delay: 0.8s; }

@keyframes curtainRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Animation: The Long Read (scroll-triggered) ─────────── */
.long-read {
  opacity: 0;
  transform: translateY(20px);
}

.long-read.visible {
  animation: longRead 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.long-read[data-delay="1"].visible { animation-delay: 0.2s; }
.long-read[data-delay="2"].visible { animation-delay: 0.4s; }
.long-read[data-delay="3"].visible { animation-delay: 0.6s; }

@keyframes longRead {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Component: The Monolith (Button) ────────────────────── */
.btn-monolith {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: background-color 0s, color 0s;
}

.btn-monolith:hover {
  background: var(--paper);
  color: var(--ink);
}

/* ── Component: The Accordion Item ───────────────────────── */
.accordion-list {
  border-bottom: 1px solid var(--surface);
}

.accordion-item {
  border-top: 1px solid var(--surface);
  transition: border-top-color 0s, background-color 0s, color 0s;
}

.accordion-item:hover {
  border-top-color: var(--accent);
  box-shadow: 0 -1px 4px rgba(255, 215, 0, 0.35);
}

.accordion-item.open {
  border-top-color: var(--accent);
  box-shadow: 0 -1px 4px rgba(255, 215, 0, 0.5);
  background-color: var(--ink);
  color: var(--paper);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 1rem;
  cursor: pointer;
  user-select: none;
}

.accordion-header-left {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex: 1;
  min-width: 0;
}

.accordion-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.1;
}

.accordion-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  white-space: nowrap;
  flex-shrink: 0;
}

.accordion-item.open .accordion-meta {
  color: rgba(249, 249, 248, 0.45);
}

.accordion-toggle {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
  color: inherit;
}

.accordion-item.open .accordion-toggle {
  transform: rotate(180deg);
}

.accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.open .accordion-body {
  grid-template-rows: 1fr;
}

.accordion-body-inner {
  overflow: hidden;
  min-height: 0;
  opacity: 0;
  transition: opacity 220ms ease;
}

.accordion-item.open .accordion-body-inner {
  opacity: 1;
  transition: opacity 320ms ease 160ms; /* delay lets height expand first */
}

.accordion-body-content {
  padding: 0.5rem 1rem 2rem;
}

/* Situation / Action / Result rows */
.dossier-row {
  display: flex;
  gap: 1.5rem;
  padding: 0.875rem 0;
  border-top: 1px solid rgba(235, 235, 233, 0.12);
}

.dossier-row:first-child {
  border-top: none;
}

.dossier-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(249, 249, 248, 0.38);
  width: 80px;
  flex-shrink: 0;
  padding-top: 0.15em;
}

.dossier-value {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.65;
  color: rgba(249, 249, 248, 0.8);
}

.accordion-framing {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.45;
  color: rgba(249, 249, 248, 0.6);
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(235, 235, 233, 0.12);
}

/* ── Component: The Phase Card ───────────────────────────── */
.phase-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.phase-card {
  position: relative;
  overflow: visible;
  padding-top: 1.5rem;
}

.phase-card:nth-child(2) {
  margin-top: 3rem;
}

.phase-card:nth-child(3) {
  margin-top: 6rem;
}

.phase-card-numeral {
  position: absolute;
  top: -1rem;
  left: -0.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 200;
  font-size: 120px;
  color: var(--surface);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.phase-card-rule {
  width: 3rem;
  height: 1px;
  background: var(--ink);
  margin: 4rem 0 1rem;
  transition: width 300ms ease, background-color 300ms ease;
  position: relative;
  z-index: 1;
}

.phase-card:hover .phase-card-rule {
  width: 100%;
  background-color: var(--accent);
}

.phase-card-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.phase-card-body {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ink-mid);
  position: relative;
  z-index: 1;
}

/* ── Component: The Scroll Indicator ─────────────────────── */
.scroll-indicator {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 1px;
  height: 64px;
  background: rgba(18, 18, 18, 0.2);
  z-index: 100;
}

.scroll-indicator-fill {
  width: 100%;
  height: 0;
  background: var(--accent);
  transition: height 0.1s linear;
}

/* ── Component: The Annotator's Mark ─────────────────────── */
.annotator-mark {
  position: relative;
  display: inline;
}

.annotator-mark::after {
  content: '';
  position: absolute;
  left: -2%;
  bottom: 0.1em;
  width: 104%;
  height: 0.3em;
  background-color: var(--accent);
  z-index: -1;
  opacity: 0.9;
  transform: rotate(-1deg);
  border-radius: 2px 8px 6px 4px;
}

/* ── Component: The Link Fill Hover ──────────────────────── */
.link-fill {
  position: relative;
  display: inline-block;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
  line-height: 1.4;
  padding-bottom: 2px;
}

.link-fill::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: var(--accent);
  transition: height 300ms cubic-bezier(0.645, 0.045, 0.355, 1);
  z-index: -1;
}

.link-fill:hover::after {
  height: 100%;
}

/* ── Component: Callout Block ────────────────────────────── */
.callout-block {
  border-left: 2px solid var(--accent);
  padding: 0.875rem 1.25rem;
  margin: 2rem 0;
}

.callout-block p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  line-height: 1.5;
  color: var(--ink-mid);
}

/* ── Component: Section Divider ──────────────────────────── */
.section-divider {
  border: none;
  border-top: 1px solid var(--surface);
  margin: 3rem 0;
}

/* ── Component: Stat Item ────────────────────────────────── */
.stat-item {
  margin-bottom: 2.25rem;
}

.stat-number {
  display: block;
  font-family: var(--font-serif);
  font-weight: 200;
  font-style: italic;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.stat-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-mid);
  margin-bottom: 0.3rem;
}

.stat-source {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-mute);
}

/* ── Component: Credential List ──────────────────────────── */
.credential-list {
  margin-bottom: 2rem;
}

.credential-list li {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-mid);
  padding: 0.625rem 0 0.625rem 1.25rem;
  border-bottom: 1px solid var(--surface);
  position: relative;
}

.credential-list li::before {
  content: '★';
  position: absolute;
  left: 0;
  font-size: 8px;
  top: 0.85rem;
  color: var(--accent);
}

/* ── Component: Stamp Badge ──────────────────────────────── */
.stamp-badge {
  display: inline-block;
  border: 1px solid var(--surface);
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.7rem;
}

/* ── Component: Sources Block ────────────────────────────── */
.sources-block {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  line-height: 1.7;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--surface);
}

/* ── Component: Fee Note ─────────────────────────────────── */
.fee-note {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-mute);
  border: 1px solid var(--surface);
  padding: 0.875rem 1.25rem;
  margin-top: 2rem;
}

/* ── Component: Outcome Strip ────────────────────────────── */
.outcome-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--surface);
}

.outcome-disclaimer {
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  line-height: 1.7;
}

/* ── Component: Diagram Block ────────────────────────────── */
.diagram-block {
  margin: 2.5rem 0;
  width: 100%;
}

.diagram-block svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Component: Contact Details ──────────────────────────── */
.contact-details {
  margin: 2rem 0;
  text-align: right;
}

.contact-detail-item {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-mute);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--surface);
  display: block;
}

.contact-detail-item:last-child {
  border-bottom: none;
}

/* ── The Advisor's Signature (Footer) ────────────────────── */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 3rem;
  border-top: 1px solid rgba(235, 235, 233, 0.08);
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(235, 235, 233, 0.18);
  margin-top: auto;
}

/* ── Spacing Utilities ────────────────────────────────────── */
.mt-8  { margin-top: 0.5rem; }
.mt-16 { margin-top: 1rem; }
.mt-24 { margin-top: 1.5rem; }
.mt-32 { margin-top: 2rem; }
.mt-48 { margin-top: 3rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {

  .page-grid {
    grid-template-columns: 1fr;
  }

  .aside-col {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--surface);
    padding-top: 2.5rem;
  }

  .hero-section {
    padding: 3rem 1.5rem;
  }

  .about-section {
    padding: 3rem 1.5rem;
  }

  .work-page {
    flex-direction: column;
  }

  .work-label-rail {
    width: 100%;
    height: 44px;
    border-right: none;
    border-bottom: 1px solid var(--surface);
    padding: 0 1.5rem;
    justify-content: flex-start;
  }

  .work-label-rail .section-label-vertical {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .work-content {
    padding: 2.5rem 1.5rem;
  }

  .phase-cards {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .phase-card:nth-child(2),
  .phase-card:nth-child(3) {
    margin-top: 0;
  }

  .top-nav {
    padding: 1.25rem 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .top-nav-links {
    gap: 1.25rem;
    flex-wrap: wrap;
  }

  .value-hero,
  .value-body,
  .phase-section {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .future-main,
  .future-body {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .contact-main {
    align-items: flex-start;
    text-align: left;
    padding: 3rem 1.5rem;
  }

  .contact-details {
    text-align: left;
  }

  .scroll-indicator {
    display: none;
  }

  .outcome-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    padding: 1.25rem 1.5rem;
  }

  .page-header {
    padding: 1.5rem;
  }

  .accordion-header {
    padding: 1.25rem 0.75rem;
  }

  .accordion-header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .accordion-meta {
    white-space: normal;
  }

  .accordion-body-content {
    padding: 0.5rem 0.75rem 1.5rem;
  }

  .dossier-row {
    flex-direction: column;
    gap: 0.4rem;
  }

  .dossier-label {
    width: auto;
  }
}
