/* ============================================================
   Craig Girvan — styles.css
   Redesigned: editorial, typographic, restrained

   Palette:
     --bg:        #F6F5F1  warm white
     --bg-tint:   #EFEDE8  slightly deeper
     --ink:       #191917  near-black
     --ink-mid:   #4C4B47  secondary text
     --ink-light: #8C8880  muted/labels
     --rule:      #C8C5BC  hairline borders
     --accent:    #3A5F5F  dark teal (links, button)
     --accent-h:  #2B4848  hover

   Type:
     Display: 'DM Serif Display' italic — ONLY for the 25+ numeral
     Body/UI: 'Inter' — all other text, clean and restrained
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@1&family=Inter:wght@300;400;500&display=swap');

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: #F6F5F1;
  color: #191917;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

:focus-visible {
  outline: 2px solid #3A5F5F;
  outline-offset: 3px;
  border-radius: 1px;
}

/* ── Custom properties ───────────────────────────────────── */
:root {
  --bg: #F6F5F1;
  --bg-tint: #EFEDE8;
  --ink: #191917;
  --ink-mid: #4C4B47;
  --ink-light: #8C8880;
  --rule: #C8C5BC;
  --accent: #3A5F5F;
  --accent-h: #2B4848;
  --max: 1080px;
  --gutter: clamp(1.5rem, 5vw, 4rem);
  --section-pad: clamp(4rem, 8vw, 8rem);
}

/* ── Layout scaffold ─────────────────────────────────────── */
/* Every section uses a two-column scaffold:
   left: narrow label column
   right: content
   This creates the editorial spine effect without a literal border line */

.section-inner,
.opening-inner,
.nav-inner,
.footer-inner {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ============================================================
   NAVIGATION
============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  /* Transparent at top, subtle on scroll — JS adds .scrolled */
  background: transparent;
  transition: background 0.3s ease;
}

.site-header.scrolled {
  background: rgba(246, 245, 241, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.nav-list {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-list a {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mid);
  transition: color 0.15s;
}

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

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .nav-list {
    display: none;
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1rem var(--gutter) 1.5rem;
  }

  .nav-list li {
    width: 100%;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--rule);
  }
  .nav-list li:last-child { border-bottom: none; }
  .nav-list a { font-size: 0.9rem; }

  .site-header.nav-open .nav-list { display: flex; }
}

/* ============================================================
   OPENING / HERO
   The signature element: oversized italic serif numeral
============================================================ */
.opening {
  padding-top: clamp(7rem, 15vw, 12rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
  border-bottom: 1px solid var(--rule);
}

.opening-inner {
  display: grid;
  /* Number left, text right — asymmetric */
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
}

/* The number */
.opening-number {
  /* Overflow intentionally — number is larger than its container */
  overflow: visible;
}

.number-display {
  display: block;
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  /* Clamp: min 6rem on tiny screens, preferred 18vw, max 14rem */
  font-size: clamp(6rem, 18vw, 14rem);
  line-height: 0.88;
  color: var(--ink);
  letter-spacing: -0.02em;
  /* Slight left pull — feels anchored, not floated */
  margin-left: -0.04em;
  /* Fade in on load */
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.7s ease forwards 0.1s;
}

/* Descriptor line — small caps feel */
.opening-descriptor {
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  font-weight: 400;
  color: var(--ink-mid);
  letter-spacing: 0.01em;
  line-height: 1.5;
  margin-bottom: 2.5rem;
  max-width: 36ch;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.25s;
}

.opening-id {
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.35s;
}

.opening-name {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 0.15rem;
}

.opening-role {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-light);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.opening-bio {
  font-size: 0.95rem;
  color: var(--ink-mid);
  line-height: 1.7;
  max-width: 44ch;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.45s;
}

.text-link {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.55s;
  display: inline-block;
}

.text-link:hover { color: var(--accent-h); }

/* Responsive: stack on narrow screens */
@media (max-width: 720px) {
  .opening-inner {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .number-display {
    font-size: clamp(5.5rem, 22vw, 9rem);
    margin-bottom: 1.5rem;
  }

  .opening-descriptor { max-width: none; }
  .opening-bio { max-width: none; }
}

/* ── Fade in animation ───────────────────────────────────── */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   PAGE RULE — thin full-width hairline between sections
============================================================ */
.page-rule {
  height: 1px;
  background: var(--rule);
  max-width: var(--max);
  margin-inline: auto;
  /* Let it bleed slightly wider than content */
}

/* ============================================================
   SHARED SECTION STYLES
============================================================ */
.section {
  padding-block: var(--section-pad);
  border-bottom: 1px solid var(--rule);
}

.section--tinted { background: var(--bg-tint); }

/* Two-column layout: label left, content right */
.section-inner {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
  padding-top: 0.25rem;
  /* Sticky label tracks content on desktop */
  position: sticky;
  top: 5rem;
}

/* Prose column — reusable for How I Work etc */
.prose-column p {
  font-size: 1rem;
  color: var(--ink-mid);
  line-height: 1.75;
  margin-bottom: 1.1rem;
  max-width: 58ch;
}
.prose-column p:last-child { margin-bottom: 0; }

@media (max-width: 680px) {
  .section-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .section-label {
    position: static;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.75rem;
  }
}

/* ============================================================
   AREAS OF SUPPORT
============================================================ */
.support-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 3rem) clamp(2rem, 5vw, 4rem);
}

.support-item h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.support-item p {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.7;
}

@media (max-width: 560px) {
  .support-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ============================================================
   BACKGROUND — portrait lives here
============================================================ */
.background-body {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 3rem;
  align-items: start;
}

.background-prose p {
  font-size: 1rem;
  color: var(--ink-mid);
  line-height: 1.75;
  margin-bottom: 1.1rem;
  max-width: 56ch;
}
.background-prose p:last-child { margin-bottom: 0; }

.background-portrait img {
  width: 100%;
  border-radius: 1px;
  /* Already B&W — subtle warmth filter */
  filter: sepia(8%);
}

@media (max-width: 560px) {
  .background-body {
    grid-template-columns: 1fr;
  }
  .background-portrait {
    width: 140px;
  }
}

/* ============================================================
   CONTACT
============================================================ */
.contact-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.contact-intro p {
  font-size: 0.95rem;
  color: var(--ink-mid);
  line-height: 1.7;
  margin-bottom: 0.85rem;
}
.contact-intro p:last-child { margin-bottom: 0; }

/* Form */
.contact-form { width: 100%; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1.1rem;
}

label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-light);
}

input, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 1px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
  transition: border-color 0.15s;
  appearance: none;
}

/* Tinted sections have slightly different bg — keep input on base bg */
.section--tinted input,
.section--tinted textarea {
  background: var(--bg);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea { resize: vertical; min-height: 120px; }

input.is-invalid, textarea.is-invalid { border-color: #b04040; }

.field-error {
  font-size: 0.75rem;
  color: #b04040;
  min-height: 1rem;
}

.form-footer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.btn-submit {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 1px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-submit:hover, .btn-submit:focus-visible { background: var(--accent-h); }
.btn-submit:disabled { opacity: 0.5; cursor: default; }

.form-status {
  font-size: 0.82rem;
  color: var(--ink-mid);
}
.form-status.success { color: var(--accent); }
.form-status.error   { color: #b04040; }

@media (max-width: 640px) {
  .contact-body { grid-template-columns: 1fr; }
}

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--rule);
}

.footer-inner {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--ink-light);
  letter-spacing: 0.02em;
}
