/* ==========================================================================
   zackbatchelor.com — global stylesheet
   Brand colours, type and the logo's slash angle all live in :root,
   so most visual tweaks only need to happen there.
   ========================================================================== */

:root {
  /* Brand palette — forest is taken straight from the logo artwork */
  --forest: #213539;
  --forest-2: #2c464b;
  --paper: #f4f2ea;
  --paper-2: #eae7dc;
  --sage: #8e9c84;        /* "Village Maze"-style sage */
  --sage-soft: #d5dccd;

  --ink: var(--forest);
  --ink-muted: #556661;
  --line: #d9d6c9;

  /* Display type mirrors the logo's sharp geometric caps; body stays readable */
  --font-display: "Josefin Sans", "Futura", "Century Gothic", sans-serif;
  --font-body: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* The angle of the bands in the logo mark */
  --slash: 33deg;
  --slash-offset: 2.5rem;

  --max-width: 1160px;
  --gutter: 1.25rem;
  --ease: cubic-bezier(.65, 0, .35, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  line-height: 1.1;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2.2rem, 6vw, 4.4rem); letter-spacing: .06em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.15rem; letter-spacing: .1em; }

p { margin: 0 0 1em; }

a { color: inherit; text-decoration-color: var(--sage); text-underline-offset: .2em; }
a:hover { text-decoration-color: currentColor; }

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1.25rem;
}

.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); max-width: 38em; }

/* --------------------------------------------------------------------------
   Header & navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.site-logo { display: block; color: var(--forest); width: 210px; }
.site-logo img { width: 100%; height: auto; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: .5rem;
  cursor: pointer;
  color: var(--forest);
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  margin: 6px 0;
  background: currentColor;
  transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(-33deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-33deg); }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2rem;
}

.site-nav a {
  position: relative;
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .4rem 0;
}

/* Underline drawn as a slash-angled bar that grows on hover */
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--sage);
  transform: scaleX(0) skewX(calc(var(--slash) * -1));
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1) skewX(calc(var(--slash) * -1)); }

@media (max-width: 760px) {
  .site-logo { width: 170px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--forest);
    clip-path: inset(0 0 100% 0);
    transition: clip-path .45s var(--ease);
  }
  .site-nav.is-open { clip-path: inset(0 0 0 0); }
  .site-nav ul { flex-direction: column; gap: 0; padding: 1rem var(--gutter) 1.5rem; }
  .site-nav a { display: block; color: var(--paper); font-size: 1.1rem; padding: .9rem 0; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 1.6rem;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 2px solid currentColor;
  transition: color .35s var(--ease);
}
/* A slash-angled fill sweeps in on hover */
.button::before {
  content: "";
  position: absolute;
  inset: -2px -30%;
  z-index: -1;
  background: var(--fill, var(--sage));
  transform: translateX(-110%) skewX(calc(var(--slash) * -1));
  transition: transform .45s var(--ease);
}
.button:hover::before, .button:focus-visible::before { transform: translateX(0) skewX(calc(var(--slash) * -1)); }
.button .arrow { transition: transform .35s var(--ease); }
.button:hover .arrow { transform: translateX(4px); }

.button.on-dark { color: var(--paper); --fill: var(--sage); }
.button.on-dark:hover { color: var(--forest); }
.button.on-light { color: var(--forest); --fill: var(--forest); }
.button.on-light:hover { color: var(--paper); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

/* --------------------------------------------------------------------------
   Hero (home) and page intros
   -------------------------------------------------------------------------- */

.hero, .page-intro {
  position: relative;
  overflow: hidden;
  background: var(--forest);
  color: var(--paper);
}

/* Faint slash stripes across the dark bands */
.hero::before, .page-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(calc(90deg - var(--slash)),
      transparent 0 46px, rgba(244, 242, 234, .035) 46px 48px);
  pointer-events: none;
}

.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: 2rem;
  min-height: min(82vh, 720px);
  padding-top: 4rem;
  padding-bottom: 5rem;
}

.hero h1 { margin-bottom: 1.5rem; }
.hero h1 .thin { display: block; margin-top: .35em; font-size: .52em; font-weight: 300; letter-spacing: .12em; color: var(--sage-soft); }
.hero .lead { color: rgba(244, 242, 234, .82); }

.hero-mark {
  position: relative;
  aspect-ratio: 208 / 194;
  width: 100%;
  max-width: 440px;
  justify-self: end;
}
.hero-mark svg { width: 100%; height: auto; overflow: visible; }
.hero-mark path {
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
  will-change: transform;
}
.hero-mark .band-a { fill: var(--paper); transform: translate(var(--ax, 0px), var(--ay, 0px)); }
.hero-mark .band-b { fill: var(--sage); transform: translate(var(--bx, 0px), var(--by, 0px)); }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  width: 2px;
  height: 44px;
  background: rgba(244, 242, 234, .25);
  overflow: hidden;
}
.scroll-cue::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sage);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

.page-intro .container { position: relative; padding-top: 5rem; padding-bottom: 4.5rem; }
.page-intro p { max-width: 40em; color: rgba(244, 242, 234, .82); font-size: 1.15rem; margin: 0; }

/* Diagonal cut along the bottom of dark bands, at the logo's angle */
.hero, .page-intro { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--slash-offset)), 0 100%); }

@media (max-width: 760px) {
  .hero .container { grid-template-columns: 1fr; min-height: 0; padding-top: 3rem; }
  .hero-mark { order: -1; max-width: 160px; justify-self: start; }
  .scroll-cue { display: none; }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section { padding: 5rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; max-width: 30em; color: var(--ink-muted); }

/* --------------------------------------------------------------------------
   Domain "keyholes" — expanding panels on the home page
   -------------------------------------------------------------------------- */

.keyholes {
  display: flex;
  gap: .75rem;
  height: 460px;
}

.keyhole {
  --bg: var(--forest);
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--paper);
  text-decoration: none;
  transition: flex-grow .6s var(--ease);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.keyhole:nth-child(2) { --bg: var(--forest-2); }
.keyhole:nth-child(3) { --bg: #3d5650; }
.keyhole:nth-child(4) { --bg: #5d6f63; }

.keyhole.is-active { flex-grow: 3.2; }

/* Large slash band that slides across the active panel */
.keyhole::before {
  content: "";
  position: absolute;
  width: 220%;
  height: 34%;
  left: -60%;
  top: 58%;
  background: var(--sage);
  opacity: .22;
  transform: rotate(calc(var(--slash) * -1)) translateX(-30%);
  transition: transform .9s var(--ease), opacity .6s;
}
.keyhole.is-active::before { transform: rotate(calc(var(--slash) * -1)) translateX(5%); opacity: .35; }

.keyhole-inner {
  position: absolute;
  inset: 0;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.keyhole .num {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--sage-soft);
}

.keyhole h3 {
  font-size: 1.35rem;
  margin: 0;
  white-space: nowrap;
  /* Collapsed panels read their title vertically */
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  transition: opacity .3s;
}
.keyhole.is-active h3 { writing-mode: horizontal-tb; transform: none; white-space: normal; font-size: clamp(1.4rem, 2.6vw, 2rem); }

.keyhole .reveal-copy {
  max-width: 30em;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .4s, transform .5s var(--ease);
  pointer-events: none;
}
.keyhole.is-active .reveal-copy { opacity: 1; transform: none; transition-delay: .25s; pointer-events: auto; }
.keyhole .reveal-copy p { color: rgba(244, 242, 234, .85); margin-bottom: 1rem; }
.keyhole .more {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sage-soft);
}

@media (max-width: 860px) {
  .keyholes { flex-direction: column; height: auto; }
  .keyhole { flex: none; }
  .keyhole-inner { position: relative; gap: 1rem; }
  .keyhole h3, .keyhole.is-active h3 { writing-mode: horizontal-tb; transform: none; white-space: normal; font-size: 1.4rem; }
  .keyhole .reveal-copy { opacity: 1; transform: none; pointer-events: auto; }
}

/* --------------------------------------------------------------------------
   Stats strip
   -------------------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border-top: 2px solid var(--forest);
}
.stat { padding: 1.75rem 1.5rem 1.75rem 0; border-bottom: 1px solid var(--line); }
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1;
  margin-bottom: .5rem;
}
.stat span { color: var(--ink-muted); }

/* --------------------------------------------------------------------------
   Cards (achievements)
   -------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  padding: 2rem 1.75rem 1.75rem;
  overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
/* Corner notch cut at the slash angle */
.card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 46px;
  background: var(--sage-soft);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
  transition: background .3s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -24px rgba(33, 53, 57, .45); }
.card:hover::after { background: var(--sage); }
.card .meta {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--sage);
  margin-bottom: .75rem;
}
.card p:last-child { margin-bottom: 0; color: var(--ink-muted); }

/* --------------------------------------------------------------------------
   Experience — filter + timeline
   -------------------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 3rem;
}
.filters button {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--forest);
  background: transparent;
  border: 2px solid var(--forest);
  padding: .65rem 1.1rem;
  cursor: pointer;
  transition: background .25s, color .25s;
}
.filters button:hover { background: var(--sage-soft); }
.filters button[aria-pressed="true"] { background: var(--forest); color: var(--paper); }

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  transition: opacity .35s, transform .35s var(--ease);
}
.timeline li:last-child { border-bottom: 1px solid var(--line); }
.timeline .period {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .9rem;
}
.timeline h3 { margin-bottom: .4rem; }
.timeline p { color: var(--ink-muted); margin: 0; }

@media (max-width: 640px) {
  .timeline li { grid-template-columns: 1fr; gap: .5rem; }
}

/* Chapters on the experience page */
.chapter { padding: 3rem 0 1rem; border-top: 2px solid var(--forest); scroll-margin-top: 90px; }
.chapter + .chapter { margin-top: 3rem; }
.chapter.is-hidden { display: none; }
.chapter-head { display: grid; grid-template-columns: 180px 1fr; gap: 2rem; margin-bottom: 2rem; }
.chapter-num {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 300;
  line-height: .9;
  color: var(--sage);
}
.chapter-head h2 { margin-bottom: .25rem; }
.chapter-years {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .85rem;
  color: var(--sage);
  margin-bottom: 1rem;
}
.chapter-blurb { font-size: 1.15rem; max-width: 40em; margin: 0; }
.chapter .timeline { margin-bottom: 2rem; }
.subhead { font-size: .9rem; letter-spacing: .2em; color: var(--ink-muted); margin: 0 0 1.25rem; }
.chapter .card-grid { margin-bottom: 2rem; }

@media (max-width: 640px) {
  .chapter-head { grid-template-columns: 1fr; gap: .5rem; }
}

/* --------------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.gallery-item { margin: 0; position: relative; overflow: hidden; background: var(--forest); }
.gallery-item img, .gallery-item .placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .7s var(--ease);
}
.gallery-item .placeholder {
  display: grid;
  place-items: center;
  color: var(--sage-soft);
  font-family: var(--font-display);
  letter-spacing: .2em;
  text-transform: uppercase;
  font-size: .8rem;
  background:
    repeating-linear-gradient(calc(90deg - var(--slash)), transparent 0 22px, rgba(142, 156, 132, .18) 22px 24px),
    var(--forest);
}
.gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 1rem 1rem;
  color: var(--paper);
  font-size: .95rem;
  background: linear-gradient(transparent, rgba(33, 53, 57, .9));
  transform: translateY(100%);
  transition: transform .45s var(--ease);
}
.gallery-item:hover img, .gallery-item:hover .placeholder { transform: scale(1.05); }
.gallery-item:hover figcaption, .gallery-item:focus-within figcaption { transform: none; }
@media (hover: none) { .gallery-item figcaption { transform: none; } }

/* --------------------------------------------------------------------------
   Contact band & footer
   -------------------------------------------------------------------------- */

.contact-band {
  background: var(--sage);
  color: var(--forest);
  clip-path: polygon(0 var(--slash-offset), 100% 0, 100% 100%, 0 100%);
  padding: 6rem 0 4.5rem;
}
.contact-band .container { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.contact-band h2 { margin: 0; max-width: 16em; }

.site-footer { background: var(--forest); color: rgba(244, 242, 234, .75); padding: 2.5rem 0; font-size: .9rem; }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-footer .footer-mark { width: 34px; color: var(--sage); }
.site-footer a { color: var(--paper); }

/* --------------------------------------------------------------------------
   Scroll reveal & page transition
   -------------------------------------------------------------------------- */

.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* A forest band at the logo's angle wipes between pages */
.wipe {
  position: fixed;
  inset: -50vmax;
  z-index: 100;
  background: var(--forest);
  pointer-events: none;
  visibility: hidden;
  transform: rotate(calc(var(--slash) * -1)) translateX(-100%);
}
.wipe.is-leaving { visibility: visible; transition: transform .5s var(--ease); transform: rotate(calc(var(--slash) * -1)) translateX(0); }
.wipe-in .wipe { animation: wipe-out .6s var(--ease) .05s both; }
@keyframes wipe-out {
  from { visibility: visible; transform: rotate(calc(var(--slash) * -1)) translateX(0); }
  to { visibility: hidden; transform: rotate(calc(var(--slash) * -1)) translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .wipe { display: none; }
}
