/* ============================================
   COMMON THREAD — Main Stylesheet
   The red thread is the strategy, made visible.
   ============================================
   Table of Contents:
   1.  Variables & Reset
   2.  Base / Typography
   3.  Thread System (SVG)
   4.  Navigation
   5.  Hero
   6.  Marquee Bar
   7.  Services
   8.  About
   9.  Work
   10. Contact
   11. Footer
   12. Animations
   13. Responsive
   ============================================ */


/* ── 1. Variables & Reset ── */

:root {
  --ink:          #16110d;
  --ink-soft:     #362c25;
  --paper:        #f7f1e4;
  --paper-warm:   #efe4cd;
  --paper-line:   #e4d6b8;
  --red:          #d81324;
  --red-deep:     #970d1a;
  --red-soft:     rgba(216, 19, 36, 0.14);
  --muted:        #7c7261;
  --line:         rgba(22, 17, 13, 0.14);

  --serif: 'Playfair Display', serif;
  --sans:  'DM Sans', sans-serif;
  --mono:  'DM Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
}

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


/* ── 2. Base / Typography ── */

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  overflow-x: hidden;
}

section {
  position: relative;
  padding: 8rem 4rem;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--red);
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.4vw, 3.8rem);
  font-weight: 900;
  line-height: 1.04;
  color: var(--ink);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.section-title em {
  font-style: italic;
  color: var(--red);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--ink);
  color: var(--paper);
  padding: 1rem 2.1rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.25s, transform 0.25s;
}

.btn-primary:hover {
  background: var(--red);
  transform: translateY(-2px);
}

.btn-primary:focus-visible,
.btn-ghost:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 3px;
  transition: color 0.2s, border-color 0.2s;
}

.btn-ghost:hover {
  color: var(--red);
  border-color: var(--red);
}


/* ── 3. Thread System ── */
/* Each section owns one absolutely-positioned SVG that draws its
   segment of the single red thread. Paths are revealed with a
   pathLength-based dash animation so the thread looks "pulled"
   into place as the section enters view. */

.thread-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.thread-layer.thread-front {
  z-index: 5;
}

.thread-path {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.25;
  stroke-linecap: round;
  filter: url(#threadRough);
  opacity: 0.9;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.8s cubic-bezier(.22,.61,.28,1);
}

.thread-path.thread-thin {
  stroke-width: 1.4;
  opacity: 0.55;
}

.thread-layer.visible .thread-path {
  stroke-dashoffset: 0;
}

.thread-dot {
  fill: var(--red);
  opacity: 0;
  transform-origin: center;
  transition: opacity 0.4s ease 1.4s, transform 0.3s ease;
}

.thread-layer.visible .thread-dot {
  opacity: 1;
}

.thread-dot.thread-dot-active {
  transform: scale(1.9);
}


/* ── 4. Navigation ── */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 4rem;
  background: rgba(247, 241, 228, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.thread-mark {
  width: 26px;
  height: 12px;
  display: inline-block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.75rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
  position: relative;
}

.nav-links a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width 0.25s ease;
}

.nav-links a:not(.nav-cta):hover::after {
  width: 100%;
}

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

.nav-links .nav-cta {
  color: var(--red);
  border: 1px solid var(--red);
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  letter-spacing: 0.1em;
}

.nav-links .nav-cta:hover {
  color: var(--paper);
  background: var(--red);
}


/* ── 5. Hero ── */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 9rem 4rem 5rem;
  position: relative;
  overflow: hidden;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 2;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--red);
}

.hero-wordmark {
  position: relative;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(4.2rem, 13vw, 10.5rem);
  line-height: 0.86;
  letter-spacing: -0.02em;
  color: var(--ink);
  z-index: 2;
}

.hero-wordmark .line2 {
  margin-left: clamp(1rem, 8vw, 7rem);
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}

.hero-tagline-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: end;
  margin-top: 3rem;
  position: relative;
  z-index: 2;
}

.hero-subheading {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 440px;
  font-weight: 400;
}

.hero-subheading strong {
  color: var(--ink);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-top: 2rem;
}

.hero-annotations {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  align-items: flex-end;
  text-align: right;
}

.hero-annotation {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  justify-content: flex-end;
}

.hero-annotation .num {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.9rem;
  color: var(--red);
  line-height: 1;
}

.hero-annotation .lbl {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 130px;
}

.hero-thread-svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: transform 0.3s ease-out;
}

.hero-thread-front {
  position: absolute;
  inset: 0;
  z-index: 3;
}


/* ── 6. Marquee Bar ── */

.marquee-bar {
  background: var(--ink);
  color: var(--paper);
  padding: 0.9rem 0;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-track {
  display: inline-block;
  animation: marquee 30s linear infinite;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.marquee-track .dot {
  color: var(--red);
  margin: 0 1.5rem;
}


/* ── 7. Services ── */

.services-section {
  background: var(--paper-warm);
}

.services-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-bottom: 5rem;
  align-items: end;
  position: relative;
  z-index: 2;
}

.services-description {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 420px;
  font-weight: 400;
}

.services-list-wrap {
  position: relative;
}

#servicesThread {
  inset: auto;
  left: 0;
  top: 0;
  width: 90px;
  height: 100%;
}

.services-list {
  list-style: none;
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
}

.service-row {
  border-bottom: 1px solid var(--line);
  position: relative;
}

.service-row-head {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 2rem 0.5rem;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.service-number {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: color 0.3s;
}

.service-name {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 700;
  color: var(--ink);
  transition: transform 0.35s ease, color 0.3s;
}

.service-arrow {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--red);
  opacity: 0;
  transform: translateX(-8px) rotate(-45deg);
  transition: opacity 0.3s, transform 0.3s;
}

.service-row.active .service-number { color: var(--red); }
.service-row.active .service-name { transform: translateX(0.6rem); color: var(--red-deep); }
.service-row.active .service-arrow { opacity: 1; transform: translateX(0) rotate(-45deg); }
.service-row:hover .service-name { transform: translateX(0.4rem); }

.service-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s ease;
}

.service-body-inner {
  overflow: hidden;
}

.service-row.active .service-body {
  grid-template-rows: 1fr;
}

.service-description {
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 620px;
  padding: 0 0.5rem 2rem 6.7rem;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0 0.5rem 2.25rem 6.7rem;
}

.tag {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--muted);
  border-radius: 999px;
  color: var(--muted);
}


/* ── 8. About ── */

.about-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5rem;
  align-items: center;
}

.about-image-frame {
  position: relative;
  z-index: 2;
}

.about-photo-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  overflow: hidden;
  position: relative;
}

.about-initials {
  font-family: var(--serif);
  font-size: 7rem;
  font-weight: 900;
  color: rgba(247, 241, 228, 0.9);
  line-height: 1;
}

.about-placeholder-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247, 241, 228, 0.4);
}

.about-content {
  position: relative;
  z-index: 2;
}

.about-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-weight: 400;
  max-width: 560px;
}

.about-body strong {
  color: var(--ink);
  font-weight: 500;
}

.about-brands {
  margin-top: 2.75rem;
}

.brands-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

.brands-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  padding: 0;
}

.brand-pill {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  position: relative;
}

.brand-pill::after {
  content: '·';
  margin-left: 1.5rem;
  color: var(--red);
  position: absolute;
}

.brand-pill:last-child::after {
  content: '';
}


/* ── 9. Work ── */

.work-section {
  background: var(--ink);
  color: var(--paper);
}

.work-section .section-label {
  color: var(--red);
}

.work-section .section-label::before {
  background: var(--red);
}

.work-section .section-title {
  color: var(--paper);
}

.work-list-wrap {
  position: relative;
}

#workThread {
  inset: auto;
  left: 0;
  top: 0;
  width: 110px;
  height: 100%;
}

.work-index {
  list-style: none;
  margin-top: 4rem;
  border-top: 1px solid rgba(247, 241, 228, 0.14);
  position: relative;
  z-index: 2;
}

.work-entry {
  display: grid;
  grid-template-columns: 110px 1fr 1.15fr;
  gap: 2.5rem;
  padding: 3rem 0;
  border-bottom: 1px solid rgba(247, 241, 228, 0.14);
  align-items: start;
  transition: background 0.3s;
}

.work-entry:hover {
  background: rgba(247, 241, 228, 0.03);
}

.work-index-num {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
}

.work-meta {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.work-category {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247, 241, 228, 0.45);
}

.work-client {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(247, 241, 228, 0.75);
}

.work-title {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.18;
  color: var(--paper);
  margin-bottom: 0.9rem;
}

.work-description {
  font-size: 0.92rem;
  line-height: 1.75;
  color: rgba(247, 241, 228, 0.55);
  margin-bottom: 1.25rem;
  max-width: 44ch;
}

.work-result {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--red);
}

.work-result::before {
  content: '—';
}


/* ── 10. Contact ── */

.contact-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}

.contact-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--muted);
  margin-bottom: 2.75rem;
  font-weight: 400;
  max-width: 460px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 2.75rem;
}

.contact-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.contact-icon {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--red);
  letter-spacing: 0.08em;
  width: 3.2rem;
  flex-shrink: 0;
}

.contact-text {
  font-size: 0.92rem;
  color: var(--ink);
}

.contact-text a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.contact-text a:hover {
  color: var(--red);
  border-color: var(--red);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
  z-index: 2;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.6rem 0.1rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--red);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-submit {
  align-self: flex-start;
  background: none;
  color: var(--ink);
  border: none;
  border-bottom: 1px solid var(--ink);
  padding: 0.4rem 0 0.6rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.form-submit:hover {
  color: var(--red);
  border-color: var(--red);
}

.form-status {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  min-height: 1em;
}

.form-status-success {
  color: var(--ink);
}

.form-status-error {
  color: var(--red);
}


/* ── 11. Footer ── */

.site-footer {
  background: var(--ink);
  color: rgba(247, 241, 228, 0.5);
  padding: 2.25rem 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(247, 241, 228, 0.1);
}

.footer-logo {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--paper);
}

.footer-copy {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}


/* ── 12. Animations ── */

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: none;
}

.fade-up:nth-child(2) { transition-delay: 0.06s; }
.fade-up:nth-child(3) { transition-delay: 0.12s; }
.fade-up:nth-child(4) { transition-delay: 0.18s; }
.fade-up:nth-child(5) { transition-delay: 0.24s; }
.fade-up:nth-child(6) { transition-delay: 0.3s; }


/* ── 13. Responsive ── */

@media (max-width: 1000px) {
  .hero-tagline-row {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-annotations {
    align-items: flex-start;
    text-align: left;
  }
  .hero-annotation {
    justify-content: flex-start;
  }
  .about-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  section { padding: 5rem 1.5rem; }

  .site-nav { padding: 1rem 1.5rem; }

  .hero { padding: 7rem 1.5rem 4rem; }

  .hero-wordmark .line2 { margin-left: 1.5rem; }

  .contact-section {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .services-intro {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .service-row-head {
    grid-template-columns: 50px 1fr auto;
    gap: 1rem;
  }

  .service-description,
  .service-tags {
    padding-left: 0.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .work-entry {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (max-width: 600px) {
  .nav-links {
    gap: 1.2rem;
  }
  .nav-links li:not(:last-child) {
    display: none;
  }
}

@media (max-width: 900px) {
  /* Keep the thread ambient rather than crossing the CTAs at narrow widths */
  .hero-thread-front {
    display: none;
  }
  .hero-thread-svg {
    opacity: 0.75;
  }
}
