/* ========================================
   Timberline Brands: design system v3
   One typeface (Archivo, variable width + weight), a survey-map palette,
   and a twelve column grid with a label rail on the left.
   ======================================== */

:root {
  --basalt: #090B0A;
  --basalt-2: #101412;
  --pine: #1C3329;
  --pine-light: #6E9280;
  --gold: #C4944A;
  --gold-deep: #8A6226;
  --bone: #ECE8DE;
  --bone-2: #DFDACD;
  --ink: #12150F;
  --lichen: #8F958C;

  --rule: rgba(236, 232, 222, 0.14);
  --rule-ink: rgba(18, 21, 15, 0.16);

  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --page: 1360px;
  --gutter: clamp(20px, 4vw, 48px);
  --space-section: clamp(88px, 12vw, 176px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: 88px;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--bone);
  background: var(--basalt);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
::selection { background: var(--gold); color: var(--basalt); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* --- Type --- */
h1, h2, h3 { font-weight: 500; font-stretch: 112%; text-wrap: balance; }
.display {
  font-size: clamp(2.6rem, 7.4vw, 7.25rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}
.title {
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: 1;
  letter-spacing: -0.035em;
}
.subtitle {
  font-size: clamp(1.25rem, 1.7vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 600;
  font-stretch: 105%;
}
.lede { font-size: clamp(1.125rem, 1.5vw, 1.3125rem); line-height: 1.5; max-width: 34em; }
.muted { color: var(--lichen); }
.note {
  font-size: 0.8125rem;
  line-height: 1.4;
  font-weight: 500;
  font-stretch: 108%;
  letter-spacing: 0.01em;
}
.figure { font-variant-numeric: tabular-nums lining-nums; }

/* --- Layout --- */
.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }
.band { position: relative; padding-block: var(--space-section); }
/* each band darkens and softens the scene behind its copy, and feathers out at both ends */
.band::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(9, 11, 10, 0.66);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
}
.vista { height: 62vh; }

/* --- The scene and its altimeter --- */
.journey { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; opacity: 0; transition: opacity 0.6s ease-out; }
.journey.is-live { opacity: 1; }
main, .footer { position: relative; z-index: 1; }
.no-journey .journey { display: none; }
.no-journey body { background: linear-gradient(rgba(9, 11, 10, 0.55), rgba(9, 11, 10, 0.55)), url('../images/hero-forest.webp') center / cover fixed var(--basalt); }
.alt { display: none; }
@media (min-width: 1100px) {
  .alt { position: fixed; left: var(--gutter); bottom: 32px; z-index: 40; display: flex; gap: 14px; align-items: stretch; opacity: 0; transition: opacity 0.4s; pointer-events: none; }
  .alt.is-on { opacity: 1; }
  .no-journey .alt { display: none; }
  .alt-bar { width: 1px; background: var(--rule); position: relative; }
  .alt-bar i { position: absolute; inset: 0; background: var(--gold); transform-origin: bottom; transform: scaleY(var(--climb, 0)); }
  .alt-num { font-size: 1.5rem; line-height: 1; font-weight: 500; font-stretch: 112%; letter-spacing: -0.03em; min-width: 4.2ch; }
  .alt-stage { color: var(--gold); margin-top: 6px; }
}

.rail { display: grid; gap: 24px; }
.rail-label { color: var(--gold); }
@media (min-width: 960px) {
  .rail { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; }
  .rail-label { grid-column: 1 / span 3; padding-top: 0.9em; }
  .rail-body { grid-column: 4 / -1; }
}

/* --- Buttons and links --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  font-weight: 600;
  font-stretch: 108%;
  font-size: 0.9375rem;
  letter-spacing: 0.005em;
  border-radius: 2px;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-solid { background: var(--gold); color: var(--basalt); }
.btn-solid:hover { background: var(--bone); }
.btn-line { border: 1px solid var(--rule); color: var(--bone); background: rgba(9, 11, 10, 0.4); }
.btn-line:hover { border-color: var(--bone); }

.link {
  font-weight: 600;
  font-stretch: 108%;
  font-size: 0.9375rem;
  padding-bottom: 3px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.3s var(--ease);
}
.link:hover { background-size: 0 1px; background-position: 100% 100%; }

/* --- Navigation (class names shared with js/main.js) --- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(9, 11, 10, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--rule);
}
.nav-inner {
  max-width: var(--page);
  margin-inline: auto;
  padding: 0 var(--gutter);
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo { font-weight: 600; font-stretch: 118%; font-size: 1.0625rem; letter-spacing: -0.01em; }
.nav-logo span { color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 38px); }
.nav-links a { font-size: 0.9375rem; font-weight: 500; font-stretch: 105%; color: var(--bone); opacity: 0.72; transition: opacity 0.2s; }
.nav-links a:hover, .nav-links a.active { opacity: 1; }
.nav-links a.nav-cta {
  opacity: 1;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 2px;
  transition: background-color 0.2s, color 0.2s;
}
.nav-links a.nav-cta:hover { background: var(--gold); color: var(--basalt); }
.nav-mobile-toggle { display: none; width: 44px; height: 44px; position: relative; z-index: 2; }
.nav-mobile-toggle span {
  position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--bone);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-mobile-toggle span:nth-child(1) { top: 15px; }
.nav-mobile-toggle span:nth-child(2) { top: 21px; }
.nav-mobile-toggle span:nth-child(3) { top: 27px; }
.nav-mobile-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-mobile-toggle.open span:nth-child(2) { opacity: 0; }
.nav-mobile-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 859px) {
  .nav-mobile-toggle { display: block; }
  .nav-links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    padding: 96px var(--gutter) 48px;
    background: var(--basalt);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s, visibility 0.25s;
  }
  .nav-links.open { visibility: visible; opacity: 1; }
  .nav-links a { font-size: 2rem; font-stretch: 112%; letter-spacing: -0.03em; opacity: 1; padding: 8px 0; }
  .nav-links a.nav-cta { font-size: 1rem; letter-spacing: 0; margin-top: 24px; min-height: 52px; padding: 0 28px; }
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: max(100svh, 640px);
  display: flex;
  align-items: flex-end;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(9, 11, 10, 0) 0%, rgba(9, 11, 10, 0.62) 16%, rgba(9, 11, 10, 0.3) 42%, rgba(9, 11, 10, 0) 68%),
    linear-gradient(to right, rgba(9, 11, 10, 0.5) 0%, rgba(9, 11, 10, 0.15) 45%, rgba(9, 11, 10, 0) 70%),
    linear-gradient(to bottom, rgba(9, 11, 10, 0.5) 0%, rgba(9, 11, 10, 0) 16%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding: 140px var(--gutter) clamp(40px, 6vw, 72px);
  display: grid;
  gap: clamp(28px, 4vw, 48px);
}
.hero-est { color: var(--gold); }
.hero-line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero-line > span { display: block; }
.hero-foot { display: grid; gap: 32px; align-items: end; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-cue { display: none; }
@media (min-width: 960px) {
  .hero-foot { grid-template-columns: minmax(0, 1fr) auto; }
  .hero-cue { display: inline-flex; align-items: center; gap: 14px; color: var(--bone); padding: 12px 0; }
  .hero-cue::after { content: ''; width: 1px; height: 56px; background: linear-gradient(var(--gold), var(--gold)) 0 0 / 100% 40% no-repeat, var(--rule); }
}
@media (min-width: 960px) and (prefers-reduced-motion: no-preference) {
  .hero-cue::after { animation: cue 2.2s var(--ease) infinite; }
}
@keyframes cue { from { background-position: 0 -60%, 0 0; } to { background-position: 0 260%, 0 0; } }

@media (prefers-reduced-motion: no-preference) {
  .hero-line > span { transform: translateY(105%); animation: rise 1.1s var(--ease) forwards; }
  .hero-line:nth-child(2) > span { animation-delay: 0.09s; }
  .hero-est, .hero-foot { opacity: 0; animation: settle 0.9s ease-out 0.7s forwards; }
  .hero-est { animation-delay: 0.1s; }
}
@keyframes rise { to { transform: none; } }
@keyframes settle { to { opacity: 1; } }

/* --- About --- */
.about-copy { display: grid; gap: 24px; margin-top: clamp(36px, 5vw, 64px); }
.about-copy p { max-width: 36em; }
@media (min-width: 760px) { .about-copy { grid-template-columns: 1fr 1fr; column-gap: 48px; } }
.about-more { margin-top: 40px; }

/* --- The formula: a ruled list --- */
.ledger { margin-top: clamp(40px, 6vw, 80px); border-bottom: 1px solid var(--rule); }
.ledger-row { display: grid; gap: 12px; padding-block: 32px; border-top: 1px solid var(--rule); }
.ledger-row p { color: var(--lichen); max-width: 38em; }
.ledger-tag { color: var(--gold); }
@media (min-width: 900px) {
  .ledger-row { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) minmax(0, 2fr); column-gap: 40px; align-items: baseline; padding-block: 40px; }
  .ledger-tag { text-align: right; }
}

/* --- Portfolio --- */
.flagship {
  margin-top: clamp(40px, 6vw, 80px);
  display: grid;
  border: 1px solid var(--rule);
  background: rgba(16, 20, 18, 0.55);
}
.flagship-logo { background: #0038BC; display: grid; place-items: center; min-height: 220px; }
.flagship-logo img { width: min(68%, 380px); }
.flagship-body { padding: clamp(24px, 4vw, 56px); }
.flagship-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; }
.flagship-head .note { color: var(--gold); }
.flagship-head .note.muted { color: var(--lichen); }
.flagship-body > p { margin-top: 16px; max-width: 34em; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 36px; border-top: 1px solid var(--rule); }
.stat { padding: 20px 16px 20px 0; border-bottom: 1px solid var(--rule); }
.stat:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--rule); }
.stat dd { font-size: clamp(1.75rem, 3.4vw, 3.25rem); line-height: 1; letter-spacing: -0.04em; font-weight: 500; font-stretch: 112%; color: var(--bone); }
.stat dt { margin-top: 8px; color: var(--lichen); }
.flagship-body .link { display: inline-block; margin-top: 32px; }
@media (min-width: 900px) {
  .flagship { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

.holdings { margin-top: 24px; border-bottom: 1px solid var(--rule); }
.holding { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px 20px; padding-block: 24px; border-top: 1px solid var(--rule); align-items: center; }
.holding-logo { position: relative; width: 96px; aspect-ratio: 16 / 10; background: #F4F1E9; overflow: hidden; }
.holding-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.holding-logo.pad img { inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
.holding-name .note { display: block; margin-top: 4px; color: var(--lichen); }
.holding-name .note b { font-weight: 600; color: var(--gold); }
.holding > p, .holding > .link { grid-column: 1 / -1; }
.holding > p { color: var(--lichen); max-width: 40em; }
.holding > .link { justify-self: start; }
@media (min-width: 900px) {
  .holding { grid-template-columns: 128px minmax(0, 3fr) minmax(0, 6fr) auto; column-gap: 40px; padding-block: 28px; }
  .holding-logo { width: 128px; }
  .holding > p, .holding > .link { grid-column: auto; }
}
.portfolio-more { margin-top: 48px; }

/* --- Team --- */
.team { margin-top: clamp(40px, 6vw, 80px); display: grid; gap: 40px; }
.person { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 24px; padding-top: 32px; border-top: 1px solid var(--rule); }
.person img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.person-role { color: var(--gold); margin-top: 6px; }
.person-role span { color: var(--lichen); }
.person p { color: var(--lichen); margin-top: 16px; max-width: 30em; }
@media (min-width: 760px) { .team { grid-template-columns: 1fr 1fr; column-gap: 48px; } }

/* --- Contact --- */
.contact { margin-top: clamp(40px, 6vw, 80px); display: grid; gap: 56px; }
@media (min-width: 900px) { .contact { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); column-gap: 72px; } }
.form-group { display: grid; gap: 8px; margin-bottom: 28px; }
.form-group label { font-size: 0.8125rem; font-weight: 500; font-stretch: 108%; color: var(--lichen); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 10px 0 14px;
  font-size: 1.125rem;
  color: var(--bone);
  transition: border-color 0.2s;
}
.form-group textarea { resize: vertical; min-height: 140px; }
.form-group select { appearance: none; -webkit-appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23C4944A' stroke-width='1.5'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 4px center; }
.form-group select option { background: var(--basalt-2); color: var(--bone); }
.form-group ::placeholder { color: #5E645C; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-bottom-color: var(--gold); }
.form-group .field-error { border-bottom-color: #E0714F; }
.form-error-msg { font-size: 0.8125rem; color: #E0714F; }
.contact-info { display: grid; gap: 40px; align-content: start; }
.contact-info-label { color: var(--lichen); margin-bottom: 10px; }
.contact-email { font-size: clamp(1.125rem, 1.6vw, 1.375rem); font-weight: 500; font-stretch: 108%; letter-spacing: -0.015em; }
.contact-location { padding-block: 14px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; }
.contact-location-role { color: var(--lichen); }

/* --- Footer --- */
.footer { border-top: 1px solid var(--rule); padding-block: 72px 32px; background: var(--basalt); }
.footer-inner { display: grid; gap: 48px; }
.footer-logo { font-weight: 600; font-stretch: 118%; font-size: 1.25rem; letter-spacing: -0.02em; }
.footer-logo span { color: var(--gold); }
.footer-tagline { color: var(--lichen); margin-top: 14px; max-width: 26em; }
.footer-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-nav-group h4 { font-size: 0.8125rem; font-weight: 500; font-stretch: 108%; color: var(--lichen); margin-bottom: 14px; }
.footer-nav-group a { display: block; padding: 5px 0; opacity: 0.85; }
.footer-nav-group a:hover { opacity: 1; color: var(--gold); }
.footer-bottom { margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; color: var(--lichen); font-size: 0.8125rem; }
.footer-locations { display: flex; gap: 24px; }
@media (min-width: 900px) { .footer-inner { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }

/* --- Scroll reveals (only when scripting is on and motion is welcome) --- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.14em; margin-bottom: -0.14em; }
  .js [data-split] .w > span { display: inline-block; transform: translateY(112%); transition: transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 50ms); }
  .js [data-split].in .w > span { transform: none; }
  .js [data-fade] { opacity: 0; transform: translateY(22px); transition: opacity 0.9s ease-out, transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
  .js [data-fade].in { opacity: 1; transform: none; }
}

/* --- Small screens --- */
@media (max-width: 759px) {
  .hero::after {
    background:
      linear-gradient(to top, rgba(9, 11, 10, 0.85) 0%, rgba(9, 11, 10, 0.5) 45%, rgba(9, 11, 10, 0) 78%),
      linear-gradient(to bottom, rgba(9, 11, 10, 0.55) 0%, rgba(9, 11, 10, 0) 16%);
  }
  .vista { height: 48vh; }
}

/* --- Moving between pages: the old one dissolves into lit fog, the new one clears out of it --- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: fog-out 0.38s ease-in both; }
  ::view-transition-new(root) { animation: fog-in 0.7s ease-out both; }
}
@keyframes fog-out { to { opacity: 0; filter: blur(14px) brightness(1.5); } }
@keyframes fog-in { from { opacity: 0; filter: blur(14px) brightness(1.5); } }
