/* ================================================
   BEN ROHR — PERSONAL SITE
   Sacred Geometry Edition · 2025

   Design principles applied:
   — Golden Ratio (φ = 1.618) for all layout proportions
   — Fibonacci sequence (8, 13, 21, 34, 55, 89px) for spacing
   — Golden ratio type scale: each size × φ from the last
   — Profile column grid: 1fr : 1.618fr (exact φ split)
   — Background dot grid at 21px (Fibonacci) intervals
   — Sharp geometric forms — no organic rounding
   ================================================ */

/* Fonts loaded via <link> in HTML head for faster rendering */

/* ========== DESIGN SYSTEM ========== */
:root {
  /* Page — deep espresso */
  --color-bg:           #18100A;

  /* Cards — warm parchment */
  --color-surface:      #F6EDD9;

  /* Gold */
  --color-gold:         #C4963A;
  --color-gold-dim:     rgba(196, 150, 58, 0.2);
  --color-gold-faint:   rgba(196, 150, 58, 0.08);

  /* Warm olive — nature, not hyperlink */
  --color-green:        #5A6B40;
  --color-green-dim:    rgba(90, 107, 64, 0.14);

  /* Text on cards — warm browns */
  --color-text-primary:   #18100A;
  --color-text-secondary: #3A2510;
  --color-text-muted:     #7A6040;

  /* Borders */
  --color-border:     rgba(196, 150, 58, 0.18);
  --color-border-mid: rgba(196, 150, 58, 0.38);

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /*
    GOLDEN RATIO TYPE SCALE (φ = 1.618) — sized up for impact
    Inter's optical sizing (opsz) means letterforms adapt at each size.
    Base bumped to 17px — more comfortable, more commanding on screen.
  */
  --text-xs:   0.75rem;    /* 12px   — labels, captions       */
  --text-sm:   0.9375rem;  /* 15px   — secondary text         */
  --text-base: 1.0625rem;  /* 17px   — body base              */
  --text-md:   1.375rem;   /* 22px   — bio, contact note      */
  --text-lg:   1.618rem;   /* 26px   — track numbers, φ×base  */
  --text-xl:   2.75rem;    /* 44px   — card titles            */
  --text-2xl:  4rem;       /* 64px   — name, commanding       */

  /*
    FIBONACCI SPACING SCALE
    8, 13, 21, 34, 55, 89 (px → rem)
  */
  --space-8:  0.5rem;      /*  8px */
  --space-13: 0.8125rem;   /* 13px */
  --space-21: 1.3125rem;   /* 21px */
  --space-34: 2.125rem;    /* 34px */
  --space-55: 3.4375rem;   /* 55px */
  --space-89: 5.5625rem;   /* 89px */

  /* Aliases for readability */
  --space-xs:  var(--space-8);
  --space-sm:  var(--space-13);
  --space-md:  var(--space-21);
  --space-lg:  var(--space-34);
  --space-xl:  var(--space-55);
  --space-2xl: var(--space-89);

  /* Sacred geometry: no rounding — pure geometric form */
  --radius: 0;

  --shadow-card: 0 2px 8px rgba(0,0,0,0.4), 0 16px 48px rgba(0,0,0,0.28);

  --max-width: 1100px;

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
}

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

html { scroll-behavior: smooth; }

/* ========== FOCUS STYLES (accessibility + keyboard nav) ========== */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

/* Buttons and links inside cards need offset against parchment */
.card :focus-visible {
  outline-color: var(--color-gold);
  outline-offset: 4px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text-secondary);
  background-color: var(--color-bg);

  /*
    Three-layer background:
    1. Deep green vignette — the "drop of nature" emanating from centre
    2. Gold dot grid at 21px (Fibonacci #8)
    3. Larger gold dot grid at 55px (Fibonacci #10) — sacred "grid of grids"
  */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(30, 50, 20, 0.20) 0%, transparent 70%),
    radial-gradient(circle, rgba(196, 150, 58, 0.10) 1px, transparent 1px),
    radial-gradient(circle, rgba(196, 150, 58, 0.04) 1px, transparent 1px);
  background-size:
    100% 100%,
    21px 21px,
    55px 55px;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--color-text-primary);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

a:hover { opacity: 0.6; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-gold);
  border-bottom: 1px solid var(--color-gold-dim);
  padding-bottom: 1px;
  letter-spacing: 0.02em;
  transition: opacity var(--transition-fast), border-color var(--transition-fast);
}

.link-arrow:hover {
  opacity: 0.7;
  border-color: transparent;
}

/* ========== PAGE ========== */
.page {
  min-height: 100vh;
  /*
    Top padding: 34px (Fibonacci) — tight enough that the work card
    peeks into view on most screens, signalling there's more below
  */
  padding: var(--space-lg) var(--space-lg) var(--space-2xl);
}

.cards {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  /* Fibonacci gap: 13px */
  gap: var(--space-sm);
}

/* ========== CARD BASE ========== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  /* Gold crown — the golden ratio line at the top */
  border-top: 2px solid var(--color-gold);
  padding: var(--space-xl);
}

/* ========== SECTION LABEL ========== */
.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-gold);
  margin-bottom: var(--space-8);
}

/* ========== PROFILE CARD ========== */
/*
  Column split in exact Golden Ratio:
  Photo column : Text column = 1 : φ (1 : 1.618)
  Profile card is the primary canvas — 3px gold crown, extra padding
*/
.profile-card {
  display: grid;
  grid-template-columns: 1fr 1.618fr;
  gap: var(--space-lg);
  align-items: start;
  border-top-width: 3px;
}

.profile-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  display: block;
  /* Sharp square — pure geometric form */
  border-radius: var(--radius);
  border: 1px solid var(--color-border-mid);
  /* Mirror so he faces right, into the content */
  transform: scaleX(-1);
}

.profile-info {
  display: flex;
  flex-direction: column;
  /* Fibonacci gap: 21px */
  gap: var(--space-md);
}

.profile-name {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-8);
  letter-spacing: -0.03em;
}

.profile-role {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.profile-role a {
  color: var(--color-gold);
  border-bottom: 1px solid var(--color-gold-dim);
  transition: opacity var(--transition-fast), border-color var(--transition-fast);
}

.profile-role a:hover {
  opacity: 0.7;
  border-color: transparent;
}

.profile-bio-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-13);
}

.profile-bio {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.profile-bio-secondary {
  font-size: var(--text-md);
  /* Deep forest green — the philosophical dimension, grounded in nature */
  color: var(--color-green);
  line-height: 1.7;
}

.profile-facts {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.profile-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  /* Fibonacci margin-top: 8px */
  margin-top: var(--space-8);
}

/* ========== BUTTONS ========== */
/* Sharp geometric rectangles — no rounding */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-8) var(--space-md);
  border-radius: var(--radius);
  border: 1.5px solid var(--color-gold);
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn:hover { opacity: 1; }

.btn-primary {
  background: var(--color-gold);
  color: #ffffff;
}

.btn-primary:hover { background: #A87E2E; }

.btn-outline {
  background: transparent;
  color: var(--color-gold);
}

.btn-outline:hover {
  background: var(--color-gold);
  color: #ffffff;
  opacity: 1;
}

/* ========== WORK CARD ========== */
.work-header {
  margin-bottom: var(--space-lg);
}

.work-header .link-arrow {
  display: inline-flex;
  margin-top: var(--space-8);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: 500;
  margin-top: var(--space-8);
}

.practice-grid {
  display: grid;
  /* Three equal columns — 3 is sacred (trinity, Fibonacci start) */
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.practice-item h3 {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 500;
  margin-bottom: var(--space-8);
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.practice-item p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* Track record stats — three numbers displayed prominently */
.track-record {
  display: flex;
  align-items: center;
  gap: 0;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.track-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 var(--space-md);
}

.track-stat:first-child {
  padding-left: 0;
}

.track-stat:last-child {
  padding-right: 0;
}

.track-number {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.track-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.track-divider {
  width: 1px;
  height: 2.5rem;
  background: var(--color-border-mid);
  flex-shrink: 0;
}

/* ========== CONTACT CARD ========== */
.contact-card {
  text-align: center;
}

.contact-card .section-label {
  display: block;
}

.contact-card .card-title {
  margin-bottom: 0;
}

.contact-note {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  max-width: 480px;
  /* Fibonacci margins: 13px top, 34px bottom */
  margin: var(--space-sm) auto var(--space-lg);
  line-height: 1.65;
}

.contact-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ========== FOOTER ========== */
.footer {
  padding: var(--space-md) var(--space-lg);
  margin-top: var(--space-8);
  border-top: 1px solid rgba(196, 150, 58, 0.12);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-text {
  font-size: var(--text-xs);
  color: rgba(246, 237, 217, 0.3);
  letter-spacing: 0.06em;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  font-size: var(--text-xs);
  color: rgba(246, 237, 217, 0.3);
  letter-spacing: 0.06em;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-gold);
  opacity: 1;
}

/* ========== ANIMATIONS ========== */
.animate-in {
  opacity: 0;
  transform: translateY(var(--space-md));
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-in.delay-1 { transition-delay: 0.13s; } /* Fibonacci: 13 */
.animate-in.delay-2 { transition-delay: 0.21s; } /* Fibonacci: 21 */

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 760px) {
  .profile-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-photo {
    width: 55%;  /* φ-derived: ~55% feels balanced on mobile */
    aspect-ratio: 1 / 1;
    margin: 0 auto;
  }

  .profile-actions {
    justify-content: center;
  }

  .practice-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .work-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .page {
    padding: var(--space-md) var(--space-md) var(--space-xl);
  }

  .track-record {
    flex-wrap: wrap;
    gap: var(--space-md);
  }

  .track-divider {
    display: none;
  }

  .track-stat {
    padding: 0;
    flex: unset;
    min-width: 40%;
  }

  .card {
    padding: var(--space-lg);
  }
}

@media (max-width: 420px) {
  .contact-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
