/* =====================================================
   BUCKFIELD WEB — style.css
   Editorial Minimal design system
   Mobile-first · 640px / 1024px breakpoints
   ===================================================== */

/* ===================== CUSTOM PROPERTIES ===================== */
:root {
  /* Palette */
  --bg: #F5F3EE;
  --text: #111111;
  --text-muted: #666666;
  --accent: #FF4D1A;
  --border: #1111111A;

  /* Typography */
  --font-display: "Fraunces", serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* Type scale */
  --text-hero: clamp(3.5rem, 11vw, 11rem);
  --text-heading: clamp(2.5rem, 6vw, 5rem);
  --text-body: 1.125rem;
  --text-small: 0.875rem;
  --text-xs: 0.75rem;

  /* Layout */
  --max-width: 1440px;
  --gutter: 24px;
  --section-pad: clamp(80px, 12vw, 160px);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.6s;
}

@media (min-width: 1024px) {
  :root {
    --gutter: 120px;
  }
}

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

html {
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ===================== TYPOGRAPHY ===================== */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.section-heading {
  font-size: var(--text-heading);
  margin-bottom: 24px;
}

.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.section-subheading {
  font-size: var(--text-body);
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 48px;
}

/* Word-split animation targets */
.split-text .word {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.15em;
  margin-bottom: -0.15em;
}

.split-text .word-inner {
  display: inline-block;
  transform: translateY(100%);
  will-change: transform;
}

/* ===================== LAYOUT ===================== */
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding-top: var(--section-pad);
  padding-bottom: var(--section-pad);
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 500;
  padding: 18px 32px;
  border-radius: 2px;
  transition: all 0.3s var(--ease-out);
  white-space: nowrap;
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-out);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

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

.btn-primary:hover {
  background: #e54315;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===================== HEADER ===================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: transform 0.4s var(--ease-out);
}

.site-header.hidden {
  transform: translateY(-100%);
}

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

.header-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.header-nav {
  display: none;
}

.nav-list {
  display: flex;
  gap: 32px;
}

.nav-list a {
  font-size: var(--text-small);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.3s;
}

.nav-list a:hover {
  color: var(--accent);
}

.header-status {
  display: none;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-text {
  color: var(--text-muted);
}

/* Nav toggle (mobile) */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  z-index: 110;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

.nav-toggle.active .nav-toggle-bar:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle.active .nav-toggle-bar:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

@media (min-width: 1024px) {
  .header-nav {
    display: block;
  }

  .header-status {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }
}

/* ===================== MOBILE NAV OVERLAY ===================== */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}

.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav-overlay ul {
  text-align: center;
}

.mobile-nav-overlay li {
  margin-bottom: 24px;
}

.mobile-nav-overlay a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  transition: color 0.3s;
}

.mobile-nav-overlay a:hover {
  color: var(--accent);
}

/* ===================== HERO ===================== */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--gutter) 48px;
  position: relative;
}

.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.hero-headline {
  font-size: var(--text-hero);
  line-height: 0.95;
  letter-spacing: -0.03em;
  max-width: 12ch;
  margin-bottom: 32px;
}

.hero-subline {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 40px;
  opacity: 0;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  opacity: 0;
}

.hero-location {
  position: absolute;
  bottom: 32px;
  left: var(--gutter);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  opacity: 0;
}

@media (min-width: 1024px) {
  .hero {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }

  .hero-location {
    left: var(--gutter);
  }
}

/* ===================== MARQUEE ===================== */
.marquee {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  overflow: hidden;
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.marquee-content {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-right: 24px;
  font-family: var(--font-mono);
  font-size: var(--text-small);
  font-weight: 500;
  letter-spacing: 0.1em;
  white-space: nowrap;
  flex-shrink: 0;
}

.marquee-dot {
  color: var(--accent);
}

/* ===================== WORK SECTION ===================== */
.project-grid {
  display: grid;
  gap: 48px;
}

.project-card {
  display: grid;
  gap: 24px;
}

.project-image {
  aspect-ratio: 16 / 9;
  background: var(--card-bg, var(--text));
  display: block;
  overflow: hidden;
  position: relative;
}

a.project-image {
  transition: transform 0.5s var(--ease-out);
}

a.project-image:hover .project-preview {
  transform: scale(1.02);
}

a.project-image:hover .preview-pill {
  transform: translateX(4px);
}

.project-info h3 a {
  transition: color 0.3s var(--ease-out);
}

.project-info h3 a:hover {
  color: var(--accent);
}

/* ----- Mini site-poster previews ----- */
.project-preview {
  position: absolute;
  inset: 0;
  padding: clamp(20px, 3.5vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.5s var(--ease-out);
  will-change: transform;
}

.preview-top,
.preview-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.preview-wordmark {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.preview-badge {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  opacity: 0.7;
  white-space: nowrap;
}

.preview-headline {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 400;
  padding-right: 10%;
}

.preview-headline em {
  font-style: italic;
}

.preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 2px;
  font-weight: 500;
  transition: transform 0.4s var(--ease-out);
}

.preview-meta {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
  white-space: nowrap;
}

/* Minster Spice — warm ink background, spice-red pill */
.preview-minster-spice {
  background: #1c1410;
  color: #f7f1e6;
}
.preview-minster-spice .preview-headline {
  font-style: italic;
}
.preview-minster-spice .preview-pill {
  background: #b8341f;
  color: #f7f1e6;
}

/* The Riverside Kitchen — slate + butter, heavy sans headline */
.preview-riverside {
  background: #1e3344;
  color: #f4ede0;
}
.preview-riverside .preview-headline {
  font-family: var(--font-body);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  font-size: clamp(1.25rem, 2.9vw, 1.9rem);
  line-height: 1;
}
.preview-riverside .preview-pill {
  background: #f0c97a;
  color: #1e3344;
}

/* Sharp & Co. — near-black with brass outline pill */
.preview-sharp {
  background: #161413;
  color: #f1ead9;
}
.preview-sharp .preview-headline {
  font-style: italic;
  font-weight: 400;
}
.preview-sharp .preview-pill {
  background: transparent;
  border: 1px solid #b8924a;
  color: #b8924a;
}

/* Petals & Stem — forest green with terracotta pill */
.preview-petals {
  background: #2d4030;
  color: #f5f1ea;
}
.preview-petals .preview-headline {
  font-weight: 400;
}
.preview-petals .preview-pill {
  background: #b85a3a;
  color: #f5f1ea;
}

/* Wimborne Window Cleaning — deep blue with yellow pill, sans headline */
.preview-wimborne {
  background: #1b4d6b;
  color: #fbfbfa;
}
.preview-wimborne .preview-headline {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.015em;
  font-size: clamp(1.25rem, 2.9vw, 1.9rem);
  line-height: 1.05;
}
.preview-wimborne .preview-pill {
  background: #f4b942;
  color: #0f1d2a;
  font-weight: 600;
}

.project-info h3 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
  margin-bottom: 4px;
}

.project-type {
  color: var(--text-muted);
  font-size: var(--text-small);
  margin-bottom: 12px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 2px;
}

/* Asymmetric offset on desktop */
@media (min-width: 1024px) {
  .project-grid {
    gap: 80px;
  }

  .project-card {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 48px;
  }

  .project-card:nth-child(even) {
    direction: rtl;
  }

  .project-card:nth-child(even) > * {
    direction: ltr;
  }

  .project-card:nth-child(odd) {
    padding-right: 8%;
  }

  .project-card:nth-child(even) {
    padding-left: 8%;
  }
}

/* ===================== ABOUT SECTION ===================== */
.about-grid {
  display: grid;
  gap: 48px;
}

.photo-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-small);
  color: var(--text-muted);
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  max-width: 520px;
}

.about-text p:last-of-type {
  color: var(--text);
}

.tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: 2fr 3fr;
    gap: 80px;
    align-items: start;
  }
}

/* ===================== PRICING SECTION ===================== */
.pricing-grid {
  display: grid;
  gap: 24px;
}

.pricing-card {
  border: 1px solid var(--border);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}

.pricing-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
}

.pricing-card--popular {
  border-color: var(--accent);
}

.popular-tag {
  position: absolute;
  top: -1px;
  right: 32px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  padding: 6px 16px;
  font-weight: 500;
}

.pricing-tier {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 8px;
  letter-spacing: 0;
  line-height: 1.2;
}

.pricing-price {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 12px;
}

.pricing-desc {
  color: var(--text-muted);
  font-size: var(--text-small);
  margin-bottom: 32px;
}

.pricing-features {
  flex: 1;
  margin-bottom: 32px;
}

.pricing-features li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-small);
}

.pricing-features li:last-child {
  border-bottom: none;
}

.pricing-cta {
  width: 100%;
  justify-content: center;
}

@media (min-width: 640px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
  }

  .pricing-card--popular {
    transform: translateY(-16px);
  }

  .pricing-card--popular:hover {
    transform: translateY(-24px);
  }
}

/* ===================== TRUST STRIP ===================== */
.trust-strip {
  padding: 48px var(--gutter);
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trust-strip p {
  font-family: var(--font-mono);
  font-size: clamp(0.875rem, 2vw, 1.125rem);
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ===================== CONTACT SECTION ===================== */
.contact-header {
  margin-bottom: 48px;
}

.contact-grid {
  display: grid;
  gap: 48px;
}

/* Form styling */
.contact-form {
  display: grid;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--text);
  padding: 12px 0;
  font-size: var(--text-body);
  border-radius: 0;
  transition: border-color 0.3s;
  -webkit-appearance: none;
  appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 24px;
}

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

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

.btn-submit {
  justify-content: center;
}

/* Contact details */
.contact-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--text-small);
  color: var(--text-muted);
}

.contact-details a {
  transition: color 0.3s;
}

.contact-details a:hover {
  color: var(--accent);
}

.contact-sep {
  color: var(--text-muted);
}

@media (min-width: 1024px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
  }

  .contact-details {
    grid-column: 1;
  }

  .btn-submit {
    width: auto;
    justify-self: start;
  }
}

@media (max-width: 1023px) {
  .btn-submit {
    width: 100%;
  }
}

/* ===================== FOOTER ===================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px var(--gutter);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.footer-contact-col {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-contact-col a {
  transition: color 0.3s;
}

.footer-contact-col a:hover {
  color: var(--accent);
}

.easter-egg-hint {
  margin-top: 4px;
  font-size: 0.625rem;
  opacity: 0.4;
}

@media (min-width: 1024px) {
  .footer-inner {
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
  }

  .footer-credit {
    text-align: right;
  }
}

/* ===================== CUSTOM CURSOR ===================== */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out);
  will-change: transform;
  opacity: 0;
}

.cursor.visible {
  opacity: 1;
}

.cursor.hovering {
  width: 40px;
  height: 40px;
}

/* Hide custom cursor on touch devices */
@media (pointer: coarse) {
  .cursor {
    display: none !important;
  }
}

/* ===================== GRID OVERLAY (Easter egg) ===================== */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.grid-overlay.active {
  opacity: 1;
}

.grid-overlay-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  padding: 0 var(--gutter);
}

.grid-col {
  border-left: 1px solid rgba(255, 77, 26, 0.1);
  border-right: 1px solid rgba(255, 77, 26, 0.1);
  background: rgba(255, 77, 26, 0.03);
}

/* ===================== REVEAL ANIMATION BASE ===================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
}

/* ===================== FORM SUCCESS STATE ===================== */
.contact-form.submitted .form-group {
  opacity: 0.5;
  pointer-events: none;
}

.form-success {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--accent);
  padding: 24px 0;
}

/* ===================== SMOOTH SCROLLBAR ===================== */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}
