/* ==========================================================================
   DESIGN TOKENS
   Palette: Ink (dark service floor) + Paper (linen ticket stock)
   Brass  = hospitality warmth  |  Teal = operational/tech precision
   Type:  Fraunces (display, editorial warmth) + Inter (body, clean & modern)
          + IBM Plex Mono (dockets, dates, data — the "receipt printer" voice)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,500&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink: #14181D;
  --ink-soft: #1E252D;
  --paper: #EFECE4;
  --paper-soft: #E6E2D6;
  --brass: #C08829;
  --brass-bright: #E0A83E;
  --teal: #2F6F6B;
  --teal-bright: #3F8B86;
  --charcoal: #23262B;
  --cream-text: #EDEAE2;
  --line: rgba(35, 38, 43, 0.14);
  --line-dark: rgba(237, 234, 226, 0.14);

  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', monospace;

  --radius: 3px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --max: 1180px;

  color-scheme: light;
  --bg: var(--paper);
  --bg-soft: var(--paper-soft);
  --fg: var(--charcoal);
  --fg-muted: rgba(35, 38, 43, 0.62);
  --card-bg: #FBF9F4;
  --border: var(--line);
  --accent: var(--brass);
  --accent-2: var(--teal);
  --nav-bg: rgba(239, 236, 228, 0.82);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--ink);
  --bg-soft: var(--ink-soft);
  --fg: var(--cream-text);
  --fg-muted: rgba(237, 234, 226, 0.64);
  --card-bg: #1A2028;
  --border: var(--line-dark);
  --accent: var(--brass-bright);
  --accent-2: var(--teal-bright);
  --nav-bg: rgba(20, 24, 29, 0.82);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--cream-text);
  padding: 12px 20px;
  z-index: 999;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- eyebrow / mono labels ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent-2);
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 500; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 500; }
h3 { font-size: 1.4rem; }
p { margin: 0; }
.lede { font-size: 1.15rem; color: var(--fg-muted); max-width: 60ch; }

section { padding: 120px 0; position: relative; }
@media (max-width: 780px) { section { padding: 76px 0; } }

.section-head { margin-bottom: 56px; max-width: 640px; }

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav-mark {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
}
.nav-mark span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--fg); }
.nav-right { display: flex; align-items: center; gap: 14px; }

.theme-toggle, .menu-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--fg);
}
.theme-toggle:hover { border-color: var(--accent); }

.btn {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ink); color: var(--cream-text); }
html[data-theme="dark"] .btn-primary { background: var(--brass-bright); color: var(--ink); }
.btn-ghost { border-color: var(--border); color: var(--fg); }
.btn-ghost:hover { border-color: var(--accent); }

.menu-toggle { display: none; }
@media (max-width: 860px) {
  .nav-links { display: none; }
  .menu-toggle { display: grid; }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 110px;
  overflow: hidden;
}
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 60px; align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }

.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}
.hero-sub { margin-top: 26px; font-size: 1.2rem; color: var(--fg-muted); max-width: 54ch; }
.hero-cta { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; }

.hero-meta {
  margin-top: 56px;
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--fg-muted);
}
.hero-meta strong { display: block; color: var(--fg); font-size: 0.95rem; font-family: var(--body); font-weight: 600; }

/* the docket — signature element */
.docket {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  position: relative;
  box-shadow: 0 30px 60px -30px rgba(20, 24, 29, 0.35);
  font-family: var(--mono);
  transform: rotate(1.2deg);
}
.docket::before, .docket::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 14px;
  background:
    radial-gradient(circle at 10px 0, transparent 7px, var(--bg) 7.5px) 0 -7px / 20px 14px repeat-x;
}
.docket::before { top: -1px; }
.docket::after { bottom: -1px; transform: rotate(180deg); }
.docket-head {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted); border-bottom: 1px dashed var(--border); padding-bottom: 12px; margin-bottom: 14px;
}
.docket-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.docket-row:last-of-type { border-bottom: none; }
.docket-row span:first-child { color: var(--fg-muted); }
.docket-total { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-weight: 600; }
.docket-total span:last-child { color: var(--accent-2); }

/* ==========================================================================
   BIO / STORY
   ========================================================================== */
.story { background: var(--bg-soft); }
.story-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 70px; }
@media (max-width: 900px) { .story-grid { grid-template-columns: 1fr; } }
.story-portrait {
  margin-top: 32px;
  width: 100%;
  max-width: 340px;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 50px -28px rgba(20, 24, 29, 0.4);
}
.story p + p { margin-top: 20px; }
.story-body p { color: var(--fg-muted); font-size: 1.05rem; }
.story-body p:first-child { color: var(--fg); font-size: 1.25rem; font-family: var(--display); font-weight: 400; line-height: 1.5; }
.pull-quote {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.5rem;
  border-left: 3px solid var(--accent);
  padding-left: 24px;
  margin: 34px 0;
  color: var(--fg);
}

/* ==========================================================================
   TIMELINE — dockets on a rail
   ========================================================================== */
.rail { position: relative; padding-left: 32px; }
.rail::before {
  content: "";
  position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px;
  background: repeating-linear-gradient(to bottom, var(--border) 0 6px, transparent 6px 12px);
}
.entry { position: relative; margin-bottom: 22px; }
.entry::before {
  content: "";
  position: absolute; left: -32px; top: 26px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--card-bg); border: 2px solid var(--accent-2);
}
.entry-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.entry-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--body);
  color: var(--fg);
}
.entry-when { font-family: var(--mono); font-size: 0.78rem; color: var(--fg-muted); white-space: nowrap; }
.entry-title { font-family: var(--display); font-size: 1.25rem; margin-top: 4px; }
.entry-role { font-size: 0.9rem; color: var(--accent-2); font-weight: 500; margin-top: 2px; }
.entry-chevron { transition: transform 0.3s var(--ease); flex-shrink: 0; color: var(--fg-muted); }
.entry[data-open="true"] .entry-chevron { transform: rotate(180deg); }
.entry-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease);
}
.entry[data-open="true"] .entry-body { max-height: 900px; }
.entry-body-inner { padding: 0 24px 26px; border-top: 1px dashed var(--border); padding-top: 20px; }
.entry-body-inner ul { margin: 14px 0 0; padding-left: 20px; color: var(--fg-muted); }
.entry-body-inner li { margin-bottom: 8px; }
.entry-media { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.entry-media .thumb { width: 100px; height: 72px; border-radius: var(--radius); object-fit: cover; border: 1px solid var(--border); }

/* ==========================================================================
   QUALIFICATIONS
   ========================================================================== */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.cert-card {
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
}
.cert-card .eyebrow { margin-bottom: 12px; }
.cert-card h4 { font-family: var(--body); font-size: 1.02rem; font-weight: 600; }
.cert-card p { color: var(--fg-muted); font-size: 0.9rem; margin-top: 8px; }

/* ==========================================================================
   PHILOSOPHY
   ========================================================================== */
.philosophy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 780px) { .philosophy-grid { grid-template-columns: 1fr; } }
.philosophy-item { background: var(--card-bg); padding: 34px 28px; }
.philosophy-item .num { font-family: var(--mono); color: var(--accent); font-size: 0.85rem; }
.philosophy-item h3 { margin-top: 14px; font-size: 1.15rem; }
.philosophy-item p { margin-top: 12px; color: var(--fg-muted); font-size: 0.95rem; }

/* ==========================================================================
   PROJECTS
   ========================================================================== */
.project-list { display: flex; flex-direction: column; gap: 2px; }
.project {
  display: grid;
  grid-template-columns: 0.9fr 1.6fr;
  gap: 40px;
  padding: 44px 0;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 820px) { .project { grid-template-columns: 1fr; gap: 18px; } }
.project-tag { font-family: var(--mono); font-size: 0.78rem; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.08em; }
.project h3 { margin-top: 10px; font-size: 1.7rem; }
.project-role { color: var(--fg-muted); font-size: 0.92rem; margin-top: 6px; }
.project-body p { color: var(--fg-muted); margin-bottom: 12px; }
.project-body strong { color: var(--fg); }
.project-stack { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.chip { font-family: var(--mono); font-size: 0.72rem; padding: 5px 10px; border: 1px solid var(--border); border-radius: 20px; color: var(--fg-muted); }
.project-impact { margin-top: 18px; display: flex; gap: 26px; flex-wrap: wrap; }
.project-impact div strong { display: block; font-family: var(--display); font-size: 1.5rem; color: var(--accent); font-weight: 500; }
.project-impact div span { font-size: 0.8rem; color: var(--fg-muted); }

/* ==========================================================================
   SKILLS — tickets, not bars
   ========================================================================== */
.skills-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.skill-ticket {
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.skill-ticket:hover { border-color: var(--accent-2); transform: translateY(-3px); }
.skill-ticket h4 { font-size: 1rem; font-weight: 600; font-family: var(--body); }
.skill-ticket p { font-size: 0.85rem; color: var(--fg-muted); margin-top: 8px; }
.skill-ticket .tag-row { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ==========================================================================
   TESTIMONIALS
   ========================================================================== */
.testi-track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
.testi-track::-webkit-scrollbar { height: 6px; }
.testi-track::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.testi-card {
  scroll-snap-align: start;
  flex: 0 0 min(420px, 85vw);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.testi-quote { font-family: var(--display); font-size: 1.15rem; font-style: italic; line-height: 1.5; }
.testi-who { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.testi-avatar { width: 44px; height: 44px; min-width: 44px; flex-shrink: 0; border-radius: 50%; object-fit: cover; background: var(--bg-soft); border: 1px solid var(--border); }
.testi-name { font-weight: 600; font-size: 0.9rem; }
.testi-role { font-size: 0.8rem; color: var(--fg-muted); }
.testi-controls { display: flex; gap: 10px; margin-top: 20px; }
.testi-controls button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: none; cursor: pointer; color: var(--fg); }
.testi-controls button:hover { border-color: var(--accent); }

/* ==========================================================================
   GALLERY & VIDEO
   ========================================================================== */
.gallery-grid { columns: 4 250px; column-gap: 14px; }
@media (max-width: 700px) { .gallery-grid { columns: 2 160px; } }
.gallery-grid img, .gallery-grid .ph {
  width: 100%; margin-bottom: 14px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
.gallery-grid img:hover { transform: scale(1.02); }
.ph {
  aspect-ratio: 4/5; display: grid; place-items: center;
  background: var(--card-bg); color: var(--fg-muted); font-family: var(--mono); font-size: 0.75rem;
}
.ph.wide { aspect-ratio: 4/3; }
.ph.tall { aspect-ratio: 3/4.4; }

.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.video-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card-bg); }
.video-frame { aspect-ratio: 16/9; background: var(--ink); display: grid; place-items: center; color: var(--cream-text); font-family: var(--mono); font-size: 0.75rem; }
.video-frame svg { opacity: 0.85; }
.video-info { padding: 16px 18px; }
.video-info h4 { font-size: 0.95rem; font-weight: 600; font-family: var(--body); }
.video-info p { font-size: 0.8rem; color: var(--fg-muted); margin-top: 4px; }

.lightbox {
  position: fixed; inset: 0; background: rgba(10, 12, 15, 0.92);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 88vh; max-width: 90vw; border-radius: 4px; }
.lightbox-close { position: absolute; top: 24px; right: 28px; background: none; border: none; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; padding: 13px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card-bg); color: var(--fg);
  font-family: var(--body); font-size: 0.95rem;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { border-color: var(--accent-2); }
.form-note { font-size: 0.78rem; color: var(--fg-muted); margin-top: 10px; }
.social-row { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.social-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 30px; padding: 9px 16px;
  font-size: 0.85rem; font-weight: 500; text-decoration: none; color: var(--fg);
  transition: border-color 0.2s, transform 0.2s;
}
.social-pill:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ==========================================================================
   PORTAL TEASER
   ========================================================================== */
.portal-band {
  background: var(--ink); color: var(--cream-text);
  border-radius: 6px;
  padding: 56px;
  display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 40px; align-items: center;
}
@media (max-width: 780px) { .portal-band { grid-template-columns: 1fr; padding: 36px 26px; } }
.portal-band .eyebrow { color: var(--brass-bright); }
.portal-band h2 { color: var(--cream-text); }
.portal-band p { color: rgba(237,234,226,0.72); margin-top: 16px; }
.portal-band .btn-primary { background: var(--brass-bright); color: var(--ink); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer { padding: 50px 0; border-top: 1px solid var(--border); }
.footer-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-row small { color: var(--fg-muted); font-size: 0.8rem; font-family: var(--mono); }

/* ==========================================================================
   REVEAL ANIMATION
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   PORTAL PAGE (portal/index.html)
   ========================================================================== */
.portal-gate {
  min-height: 100svh; display: grid; place-items: center; background: var(--ink); color: var(--cream-text); padding: 24px;
}
.gate-card { max-width: 380px; width: 100%; text-align: center; }
.gate-card .eyebrow { justify-content: center; }
.gate-card input {
  width: 100%; margin-top: 22px; padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line-dark); background: var(--ink-soft); color: var(--cream-text); text-align: center;
  font-family: var(--mono); letter-spacing: 0.1em;
}
.gate-card .btn { width: 100%; margin-top: 14px; justify-content: center; }
.gate-error { color: var(--brass-bright); font-size: 0.85rem; margin-top: 12px; display: none; font-family: var(--mono); }
.portal-doc-list { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 10px; }
.portal-doc-list a {
  display: flex; justify-content: space-between; padding: 14px 18px; border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; background: var(--card-bg); color: var(--fg);
}
.portal-doc-list a:hover { border-color: var(--accent-2); }
