/* ──────────────────────────────────────────────
   FFD shared stylesheet
   Used by /web-design/ and its case-study pages.
   The main case-file one-pager keeps its own inline CSS.
   ────────────────────────────────────────────── */

:root {
  --fire: #E8341A;
  --ember: #FF7A3C;
  --ash: #1A1A1A;
  --char: #111111;
  --smoke: #2A2A2A;
  --off-white: #F2EDE6;
  --muted: #888880;
  --border: rgba(242, 237, 230, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--char);
  color: var(--off-white);
  font-family: 'Courier Prime', 'Courier New', monospace;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.mono {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ── SKIP LINK ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--fire);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 500;
}
.skip-link:focus { left: 0; }

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 2.5rem;
  background: rgba(17, 17, 17, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

nav .nav-logo-img { height: 30px; width: auto; display: block; }

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

nav ul a {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
nav ul a:hover, nav ul a:focus-visible { color: var(--off-white); }
nav ul a[aria-current="page"] { color: var(--fire); }

.lang-switch { display: flex; gap: 0.6rem; }
.lang-switch a { font-size: 0.58rem; opacity: 0.55; }
.lang-switch a:hover { opacity: 1; }
.lang-switch a.lang-active { opacity: 1; color: var(--off-white); }

/* ── LAYOUT ── */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 2.5rem; }

section { padding: 5.5rem 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: none; }

.section-header { margin-bottom: 3rem; }

.section-number {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: var(--fire);
  display: block;
  margin-bottom: 0.75rem;
}

h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  letter-spacing: 0.02em;
  line-height: 1;
  font-weight: 400;
}
h2 em { color: var(--fire); font-style: normal; }

h3 {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fire);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

p { margin-bottom: 1.15rem; font-size: 0.86rem; }
p:last-child { margin-bottom: 0; }
p strong { color: var(--off-white); font-weight: 700; }

.lede { font-size: 1rem; color: #cdc7bf; max-width: 62ch; }

.prose { max-width: 68ch; color: #b9b3ac; }
.prose a { color: var(--fire); text-decoration: none; border-bottom: 1px solid rgba(232, 52, 26, 0.4); }
.prose a:hover { color: var(--ember); }

/* ── BREADCRUMB ── */
.crumbs {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1.75rem 0 0;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--off-white); }
.crumbs span { margin: 0 0.5rem; opacity: 0.4; }

/* ── HERO ── */
.page-hero { padding: 4rem 0 4.5rem; }

.page-hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  font-weight: 400;
  margin: 1rem 0 1.5rem;
  max-width: 18ch;
}
.page-hero h1 em { color: var(--fire); font-style: normal; }

.eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fire);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.hero-meta div { font-family: 'DM Mono', monospace; font-size: 0.6rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.hero-meta .meta-label { display: block; }
.hero-meta .meta-value { display: block; color: var(--off-white); margin-top: 0.4rem; letter-spacing: 0.1em; }

/* ── GRIDS ── */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  border: 1px solid var(--border);
  background: var(--ash);
  padding: 1.75rem;
}
.card p { color: #b0aaa3; font-size: 0.8rem; margin-bottom: 0; }
.card ul { margin: 0.75rem 0 0 1rem; color: #b0aaa3; font-size: 0.78rem; }
.card ul li { margin-bottom: 0.35rem; }

/* ── STEPS ── */
.steps { counter-reset: step; display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); }
.step { background: var(--char); padding: 1.75rem; }
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--fire);
  display: block;
  margin-bottom: 0.75rem;
}
.step h3 { color: var(--off-white); }
.step p { font-size: 0.78rem; color: #a8a29b; margin-bottom: 0; }

/* ── WORK CARDS ── */
.work-card { border: 1px solid var(--border); background: var(--ash); display: flex; flex-direction: column; }
.work-frame { aspect-ratio: 16 / 10; overflow: hidden; background: var(--smoke); border-bottom: 1px solid var(--border); }
.work-frame img, .work-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.work-body h3 { color: var(--off-white); font-size: 0.85rem; margin-bottom: 0.5rem; }
.work-body p { font-size: 0.78rem; color: #a8a29b; flex: 1; }
.work-tags { font-family: 'DM Mono', monospace; font-size: 0.55rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }

/* ── BUTTONS ── */
.btn {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--muted);
  color: var(--off-white);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { border-color: var(--off-white); }
.btn.primary { background: var(--fire); border-color: var(--fire); color: #fff; }
.btn.primary:hover { background: var(--ember); border-color: var(--ember); }
.btn + .btn { margin-left: 0.75rem; }

/* ── PRICE ── */
.price-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-bottom: 2rem; }
.price { border: 1px solid var(--border); background: var(--ash); padding: 1.75rem; }
.price .amount { font-family: 'Bebas Neue', sans-serif; font-size: 2.6rem; line-height: 1; color: var(--fire); display: block; margin: 0.5rem 0 0.75rem; }
.price p { font-size: 0.78rem; color: #a8a29b; margin-bottom: 0; }

/* ── FAQ ── */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer;
  padding: 1.35rem 0;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--off-white);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--fire); flex-shrink: 0; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 1.35rem; font-size: 0.82rem; color: #a8a29b; max-width: 72ch; }

/* ── FORM ── */
.form { max-width: 620px; }
.form-group { margin-bottom: 1.5rem; }
.form label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.form input, .form textarea, .form select {
  width: 100%;
  background: var(--ash);
  border: 1px solid var(--border);
  color: var(--off-white);
  font-family: 'Courier Prime', monospace;
  font-size: 0.85rem;
  padding: 0.85rem 1rem;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--fire); outline-offset: 1px; border-color: var(--fire); }
.form textarea { resize: vertical; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--off-white); }
footer nav { position: static; background: none; border: none; backdrop-filter: none; padding: 0; }

.fire-line { height: 1px; background: linear-gradient(90deg, transparent, var(--fire), transparent); opacity: 0.5; }

/* ── STICKY CTA BAR ──
   Always visible, no JS, so it survives the strict script-src policy.
   body gets bottom padding so it never covers the footer. */
.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 2.5rem;
  background: rgba(17, 17, 17, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(232, 52, 26, 0.55);
}

.cta-bar-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: #cdc7bf;
}
.cta-bar-text strong { color: var(--off-white); font-weight: 500; }

.cta-bar-actions { display: flex; gap: 0.6rem; flex-shrink: 0; }
.cta-bar .btn { padding: 0.7rem 1.35rem; }

body { padding-bottom: 5.5rem; }

/* ── BOOKING ── */
.booking-frame {
  width: 100%;
  min-height: 680px;
  border: 1px solid var(--border);
  background: var(--ash);
  display: block;
}

.booking-pending {
  border: 1px solid rgba(232, 52, 26, 0.45);
  background: var(--ash);
  padding: 2rem;
  max-width: 62ch;
}
.booking-pending p { font-size: 0.84rem; color: #b0aaa3; margin-bottom: 0; }

.booking-step .section-header { margin-bottom: 1.5rem; }

.slot-status {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.slot-grid { display: grid; gap: 1.75rem; }

.slot-day-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fire);
  margin-bottom: 0.75rem;
}

.slot-times { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.slot {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding: 0.7rem 1.05rem;
  border: 1px solid var(--border);
  background: var(--ash);
  color: var(--off-white);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.slot:hover { border-color: var(--muted); }
.slot:focus-visible { outline: 2px solid var(--fire); outline-offset: 2px; }
.slot.is-selected { background: var(--fire); border-color: var(--fire); color: #fff; }

.chosen-slot {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 2px solid var(--fire);
  padding-left: 0.85rem;
  margin-bottom: 2rem;
}
.chosen-slot strong { color: var(--off-white); font-weight: 400; }

.field-note {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.booking-error {
  border: 1px solid var(--fire);
  background: rgba(232, 52, 26, 0.08);
  color: var(--off-white);
  font-size: 0.78rem;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
}

.booking-done {
  border: 1px solid rgba(232, 52, 26, 0.55);
  background: var(--ash);
  padding: 2.25rem;
  max-width: 62ch;
}
.booking-done p { font-size: 0.84rem; color: #b0aaa3; }
.booking-done .route-title { display: block; margin-bottom: 0.85rem; }

[hidden] { display: none !important; }

/* ── QUOTE ROUTES ── */
.routes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-bottom: 3rem; }

.route {
  border: 1px solid var(--border);
  background: var(--ash);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: border-color 0.2s;
}
.route:hover { border-color: var(--fire); }
.route.fast { border-color: rgba(232, 52, 26, 0.45); }

.route-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fire);
  margin-bottom: 0.8rem;
}
.route-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--off-white);
  margin-bottom: 0.6rem;
}
.route p { font-size: 0.78rem; color: #a8a29b; margin-bottom: 0; }

.optional {
  font-family: 'DM Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

@media (max-width: 780px) {
  .cta-bar { flex-direction: column; align-items: stretch; gap: 0.6rem; padding: 0.8rem 1.25rem; text-align: center; }
  .cta-bar-text { font-size: 0.58rem; }
  .cta-bar-actions { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  /* Specificity has to beat the generic `.btn + .btn` stacking rule further down. */
  .cta-bar .cta-bar-actions .btn,
  .cta-bar .cta-bar-actions .btn + .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0;
  }
  body { padding-bottom: 9rem; }
  .routes { grid-template-columns: 1fr; }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-height: 500px) {
  /* Landscape phones fall outside the 700px width breakpoint, so they were still
     getting the translucent desktop bar. Solid, overshooting, tighter. */
  body { padding-top: 50px; }  /* matches the bar's visible height in landscape */

  nav {
    position: fixed;
    left: 0;
    right: 0;
    top: -110px;
    padding: calc(110px + 0.55rem) 1.25rem 0.55rem;
    background: var(--char);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 700px) {
  /* Solid, not translucent. The 0.92 alpha plus a backdrop blur let page text
     ghost through the bar on a phone, which read as smeared and unreadable.
     Desktop keeps the blur: there the bar sits over its own dark ground. */
  nav {
    /* padding-top carries the safe-area inset so the sticky bar paints the strip
       behind the status bar. Without it, page content scrolled visibly through
       that gap once iOS collapsed its toolbar. Requires viewport-fit=cover.
       padding-right reserves the corner for the pinned language switch below, or
       the scrolling link row runs underneath it. */
    /* Fixed, not sticky, on mobile. The bar has to start above the top of the
       screen to cover the band iOS leaves between the real top and where top:0
       lands, and a sticky element sits in normal flow until it sticks, so the
       overshoot padding would shove the whole page down by 110px. Fixed does not
       have that problem; body carries the height instead. */
    position: fixed;
    left: 0;
    right: 0;
    top: -110px;
    padding: calc(110px + 0.7rem) 5.5rem 0.7rem 1.25rem;
    /* One row. The links used to wrap under the logo, giving a needlessly thick
       bar on a phone; nowrap puts them on the logo's line and the row scrolls
       sideways if it ever runs out of space.

       flex-start, not the inherited space-between: pushed right, the links ended
       up hard against the pinned EN/FR/ES and it stopped being clear which was
       which. Grouped by the logo they read as one set, with clear air before the
       language switch. */
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 1rem;
    background: var(--char);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* The links used to wrap onto a second line and the language switch onto a
     third, giving a 134px sticky bar that ate the top of every screen. One
     scrollable row keeps it to logo + links. */
  nav ul {
    gap: 1.1rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  nav ul::-webkit-scrollbar { display: none; }

  /* Replaces the flow height the now-fixed bar no longer contributes. */
  body { padding-top: 53px; }  /* the bar's measured visible height */


  nav ul li { flex: 0 0 auto; }

  /* The language switch must not be one of the items that scrolls out of sight
     on a trilingual site, so it is lifted out of the scrolling row and pinned
     to the top right, beside the logo. */
  nav .lang-switch {
    position: absolute;
    right: 1.25rem;
    /* Pinning top and bottom to the content row and centring inside it, rather
       than setting top alone, keeps EN/FR/ES on the same optical line as the
       links whatever the safe-area inset turns out to be. */
    top: calc(110px + 0.85rem);
    bottom: 0.85rem;
    display: flex;
    align-items: center;
  }
  .wrap { padding: 0 1.25rem; }
  section { padding: 3.5rem 0; }
  .grid-2, .grid-3, .price-row { grid-template-columns: 1fr; }
  .hero-meta { gap: 1.5rem; }
  .btn { display: block; text-align: center; }
  .btn + .btn { margin-left: 0; margin-top: 0.75rem; }
  footer { flex-direction: column; text-align: center; }
}

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

/* 3D bay entrance. /immersive/ gates itself to fine-pointer devices 901px and up
   and redirects everything else, so offering the link on a phone meant a silent
   bounce back to the homepage. The button is shown only where the bay will
   actually open; everywhere else the same block explains why. */
.bay-cta { margin-top: 1.25rem; }
.bay-desktop-only { display: none; }

@media (max-width: 900px), (pointer: coarse) {
  .bay-enter { display: none; }
  .bay-desktop-only {
    display: block;
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--muted);
    border-left: 2px solid var(--fire);
    padding-left: 0.85rem;
  }
}
