/* ==========================================================================
   Second Story Brands — design tokens
   ========================================================================== */

:root {
  --bg-primary: #121110;
  --bg-secondary: #1A1816;
  --bg-footer: #0D0C0B;
  --text-primary: #F5F1E9;
  --text-secondary: #A39C8F;
  --accent: #C9A227;
  --card-surface: #201D1A;
  --card-border: rgba(245, 241, 233, 0.08);
  --overlay: rgba(18, 17, 16, 0.55);

  --font-display: "Fraunces", serif;
  --font-body: "Figtree", sans-serif;

  --max-width: 1200px;
  --pad-desktop: 140px;
  --pad-mobile: 80px;
  --gutter: 24px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset
   ========================================================================== */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; color: var(--text-secondary); }

button { font-family: inherit; cursor: pointer; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #121110;
  padding: 10px 16px;
  z-index: 999;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ==========================================================================
   Layout helpers
   ========================================================================== */

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

.container--narrow { max-width: 700px; }

.section {
  padding: var(--pad-desktop) 0;
  background: var(--bg-primary);
}
.section--alt { background: var(--bg-secondary); }
.section--compact { padding: 90px 0; }

.section__head { max-width: 640px; margin-bottom: 64px; }
.section__head--center { max-width: 640px; margin-left: auto; margin-right: auto; text-align: center; }

.section__intro {
  margin-top: 20px;
  font-size: 18px;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin: 0 0 20px;
}

h1 { font-size: clamp(44px, 8vw, 80px); }
h2 { font-size: clamp(34px, 5vw, 56px); margin-top: 12px; }
h3 { font-size: 24px; }

/* ==========================================================================
   Two-line brass motif — the signature device
   ========================================================================== */

.motif {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 26px;
}
.motif span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--accent);
}

.motif--pulse {
  animation: motif-pulse 3s ease-in-out infinite;
}
@keyframes motif-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 18px 36px;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.btn--primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}
.btn--primary:hover { background: var(--accent); color: var(--bg-primary); }

.btn--secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: rgba(245, 241, 233, 0.5);
}
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   Nav
   ========================================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: transparent;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
.nav.is-scrolled {
  background: rgba(18, 17, 16, 0.92);
  backdrop-filter: blur(10px);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.motif--logo { width: 18px; gap: 4px; }

.nav__wordmark {
  font-family: var(--font-display);
  font-variant: small-caps;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.nav__links {
  display: flex;
  gap: 40px;
}

.nav__links a {
  position: relative;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 14px;
}

/* nav underline motif: bottom line appears first, second slides in above */
.nav__links a::before,
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.35s var(--ease);
}
.nav__links a::before { bottom: 4px; transition-delay: 0s; }
.nav__links a::after { bottom: 9px; transition-delay: 0.08s; }
.nav__links a:hover::before,
.nav__links a:focus-visible::before { transform: scaleX(1); }
.nav__links a:hover::after,
.nav__links a:focus-visible::after { transform: scaleX(1); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
.nav__toggle span {
  width: 22px;
  height: 1px;
  background: var(--text-primary);
}

.nav__mobile {
  display: none;
  flex-direction: column;
  padding: 0 var(--gutter) 24px;
  gap: 20px;
}
.nav__mobile a {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}
.nav.is-open .nav__mobile { display: flex; }
.nav.is-open { background: rgba(18, 17, 16, 0.97); backdrop-filter: blur(10px); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(18,17,16,0.72) 0%,
    rgba(18,17,16,0.4) 22%,
    rgba(18,17,16,0.38) 48%,
    rgba(18,17,16,0.58) 68%,
    rgba(18,17,16,0.88) 100%);
}
.hero__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 48% at 50% 54%,
    rgba(18,17,16,0.85) 0%,
    rgba(18,17,16,0.6) 40%,
    rgba(18,17,16,0.2) 70%,
    rgba(18,17,16,0) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 780px;
  padding: 0 var(--gutter);
}
.hero__sub {
  max-width: 640px;
  margin: 28px auto 0;
  font-size: 18px;
  color: var(--text-secondary);
}
.hero__ctas {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 44px;
  flex-wrap: wrap;
}
.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

/* ==========================================================================
   Scroll-reveal
   ========================================================================== */

[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}
.hero [data-animate] { transition-delay: 0.1s; }

@media (prefers-reduced-motion: reduce) {
  [data-animate] { opacity: 1; transform: none; transition: none; }
  .motif--pulse { animation: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Brand row
   ========================================================================== */

.brand-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.brand-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 50% 38%, rgba(245,241,233,0.06), transparent 60%),
    var(--card-surface);
  border: 1px solid var(--card-border);
}

.brand-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.5s var(--ease);
}
.brand-card:hover img { transform: scale(1.04); }

.brand-card__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18,17,16,0) 40%, rgba(18,17,16,0.85) 100%);
}
.brand-card--dev img {
  filter: blur(9px) saturate(0.85) brightness(0.85);
  transform: scale(1.08);
}
.brand-card--dev:hover img {
  filter: blur(7px) saturate(0.9) brightness(0.9);
  transform: scale(1.1);
}
.brand-card--dev .brand-card__scrim {
  background: rgba(18, 17, 16, 0.55);
}

.brand-card__text {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 2;
}
.brand-card__text h3 {
  font-size: 26px;
  color: var(--text-primary);
}
.brand-card__text p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 15px;
}
.brand-card__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin: 0;
}
.brand-card__sub {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.brand-card--next {
  background: #0F0E0D;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  padding: 24px;
}
.brand-card--next .motif { width: 40px; }
.brand-card--next p {
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
}

/* ==========================================================================
   Stats band
   ========================================================================== */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.stat { text-align: center; }
.stat__label {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 16px;
  margin: 0 0 24px;
}
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 40px);
  color: var(--text-primary);
  margin: 0;
}
.stat__caption {
  margin-top: 14px;
  font-size: 15px;
}

/* ==========================================================================
   The Standard
   ========================================================================== */

.standard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 80px;
  align-items: start;
}
.standard__col--sticky {
  position: sticky;
  top: 140px;
}
.standard__body { margin-top: 24px; font-size: 18px; }

.standard__cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.principle-card {
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  border-radius: 2px;
  padding: 44px;
}
.principle-card__num {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 18px;
  margin: 0 0 16px;
}
.principle-card h3 { margin-bottom: 14px; color: var(--text-primary); }
.principle-card p { font-size: 16px; }

/* ==========================================================================
   Timeline
   ========================================================================== */

.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
  position: relative;
  margin-top: 24px;
  padding-top: 40px;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(201, 162, 39, 0.35);
}
.timeline__step { position: relative; }
.timeline__step::before {
  content: "";
  position: absolute;
  top: -36px;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline__num {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 16px;
  margin: 0 0 12px;
}
.timeline__step h3 { margin-bottom: 12px; color: var(--text-primary); font-size: 21px; }
.timeline__step p { font-size: 15px; }

/* ==========================================================================
   Founders
   ========================================================================== */

.founders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
  justify-content: center;
  gap: 40px;
}
.founder-card { text-align: left; }
.founder-card__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 24px;
}
.founder-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05) sepia(0.12);
}
.founder-card__pill {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(18, 17, 16, 0.75);
  border: 1px solid var(--card-border);
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 8px 14px;
  border-radius: 999px;
}
.founder-card h3 { color: var(--text-primary); margin-bottom: 10px; }
.founder-card p { font-size: 16px; }

.founders__cta {
  text-align: center;
  margin-top: 56px;
}

/* ==========================================================================
   Final CTA
   ========================================================================== */

.final-cta {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.final-cta__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.final-cta__overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 17, 16, 0.6);
}
.final-cta__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 640px;
  padding: 100px var(--gutter);
}
.final-cta__content p {
  margin-top: 20px;
  font-size: 18px;
}
.final-cta__content .hero__ctas { margin-top: 40px; }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background: var(--bg-footer);
  padding: 90px 0 0;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 70px;
  border-bottom: 1px solid var(--card-border);
}
.footer__col a {
  display: block;
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 16px;
  transition: color 0.2s;
}
.footer__col a:hover { color: var(--accent); }
.footer__tagline {
  margin-top: 20px;
  font-size: 15px;
  max-width: 260px;
}
.footer__heading {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin: 0;
}
.footer__social {
  display: flex;
  gap: 16px;
  margin-top: 18px;
}
.footer__social a {
  width: 38px;
  height: 38px;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color 0.2s, border-color 0.2s;
}
.footer__social a:hover { color: var(--accent); border-color: var(--accent); }
.footer__email { margin-top: 18px; }
.footer__email a:hover { color: var(--accent); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.footer__legal { display: flex; gap: 28px; }
.footer__legal a:hover { color: var(--accent); }

/* ==========================================================================
   Contact modal
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 12, 11, 0.8);
  backdrop-filter: blur(4px);
}
.modal__panel {
  position: relative;
  z-index: 2;
  background: var(--card-surface);
  border: 1px solid var(--card-border);
  border-radius: 2px;
  padding: 48px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal__panel .motif { margin-bottom: 20px; }
.modal__panel h2 { color: var(--text-primary); font-size: 28px; }
.modal__sub { margin-top: 12px; margin-bottom: 28px; font-size: 15px; }
.modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 26px;
  line-height: 1;
  padding: 4px;
}
.modal__close:hover { color: var(--accent); }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.contact-form label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin-bottom: -10px;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 14px 16px;
  border-radius: 2px;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--accent); }

.contact-form__check {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-secondary);
  margin-top: 4px;
}
.contact-form__check input { margin-top: 3px; }

.contact-form .btn { margin-top: 8px; }
.contact-form .btn:disabled { opacity: 0.6; cursor: default; }

.contact-form__honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.contact-form__status {
  min-height: 1em;
  font-size: 14px;
  color: var(--accent);
  margin: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .standard {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .standard__col--sticky { position: static; }
  .timeline { grid-template-columns: repeat(3, 1fr); row-gap: 60px; }
}

@media (max-width: 860px) {
  .brand-row {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .brand-card { scroll-snap-align: start; }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 48px 24px; }

  .timeline {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 0;
  }
  .timeline::before {
    top: 0;
    bottom: 0;
    left: 4px;
    right: auto;
    width: 1px;
    height: auto;
  }
  .timeline__step {
    padding-left: 32px;
    padding-bottom: 40px;
  }
  .timeline__step::before { top: 6px; left: 0; }

  .footer__grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 640px) {
  :root { --pad-desktop: 80px; }
  .section { padding: var(--pad-mobile) 0; }
  .section--compact { padding: 64px 0; }

  .nav__links { display: none; }
  .nav__toggle { display: flex; }

  .hero__ctas { flex-direction: column; align-items: stretch; }
  .hero__ctas .btn { text-align: center; }

  /* Tall narrow viewports force object-fit:cover to scale the 16:9 video up
     ~1.5x to fill height, cropping in tight on the subject right behind the
     headline. Darken and soften it further so the headline stays the focus. */
  .hero__bg { filter: brightness(0.68) saturate(0.85); }
  .hero__overlay {
    background: linear-gradient(180deg,
      rgba(18,17,16,0.8) 0%,
      rgba(18,17,16,0.55) 22%,
      rgba(18,17,16,0.5) 48%,
      rgba(18,17,16,0.68) 68%,
      rgba(18,17,16,0.92) 100%);
  }
  .hero__vignette {
    background: radial-gradient(ellipse 75% 55% at 50% 48%,
      rgba(18,17,16,0.88) 0%,
      rgba(18,17,16,0.7) 45%,
      rgba(18,17,16,0.35) 72%,
      rgba(18,17,16,0.1) 100%);
  }

  .footer__bottom { flex-direction: column; gap: 14px; text-align: center; }

  .modal__panel { padding: 32px 24px; }
}
