/*
Theme Name: Sane Seven — Signature
Theme URI: https://saneseven.com
Author: Sane Seven
Description: Routing hub for the Sane Seven studio. One consolidated brand entry that sends visitors to the correct practice — Editorial, Brands, or Women & Power — with enough context for cold traffic and enough restraint for a picture desk or a government procurement lead. Classic theme, editable entirely through the Customizer. Built for WCAG 2.2 AA posture and fast first paint.
Version: 1.9.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sane-seven
*/

/* ---------------------------------------------------------------------------
   Tokens
   Palette is deliberately not the AI-default cream/terracotta: ground is a cool
   near-black, type is a warm bone, the single accent is a restrained brass used
   only on rules, labels and the filing codes.
--------------------------------------------------------------------------- */
:root {
  --ink:        #0b0b0d;
  --ink-2:      #131316;
  --bone:       #ece6da;
  --bone-dim:   rgba(236, 230, 218, 0.62);
  --bone-faint: rgba(236, 230, 218, 0.40);
  --brass:      #c2a15a;
  --line:       rgba(236, 230, 218, 0.14);
  --line-soft:  rgba(236, 230, 218, 0.08);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 64px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------------------
   Reset / base
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* Accessibility: skip link + visible focus */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--bone); color: var(--ink);
  padding: 10px 16px; font: 600 14px/1 var(--font-ui);
}
.skip-link:focus { left: 12px; top: 12px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.eyebrow {
  font: 600 12px/1 var(--font-ui);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--brass);
}

/* ---------------------------------------------------------------------------
   Masthead
--------------------------------------------------------------------------- */
.masthead {
  position: relative; z-index: 3;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px;
  padding-block: clamp(20px, 3.4vw, 34px);
}
.wordmark {
  font: 700 clamp(15px, 1.5vw, 17px)/1 var(--font-ui);
  letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--bone);
}
.masthead nav a {
  font: 600 12px/1 var(--font-ui);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bone-dim);
  transition: color 0.3s var(--ease);
}
.masthead nav a:hover { color: var(--bone); }

/* ---------------------------------------------------------------------------
   Hero
--------------------------------------------------------------------------- */
.hero { padding-block: clamp(12px, 3vw, 32px) clamp(18px, 2.6vw, 30px); }
.hero__eyebrow { margin: 0 0 clamp(12px, 1.6vw, 18px); }
.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 340;
  font-size: clamp(2.5rem, 7.4vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  max-width: 15ch;
}
.hero__title em { font-style: italic; color: var(--brass); }

/* ---------------------------------------------------------------------------
   Plates — three parallel practices. Shorter bands so all three read on the
   first screen (triage, not scroll). The picture-desk filing code (ED/BR/WP) is
   the one structural marker — honest to a studio that files covers, not decor.
--------------------------------------------------------------------------- */
.plates { padding-bottom: clamp(24px, 4vw, 44px); }
.plate {
  position: relative;
  display: block;
  min-height: clamp(216px, 27vw, 320px);
  margin-top: clamp(10px, 1.2vw, 16px);
  overflow: hidden;
  background: var(--ink-2);
  isolation: isolate;
}
.plate:first-child { margin-top: 0; }

.plate__view { position: absolute; inset: 0; z-index: 0; }
.plate__view--d { display: none; }

/* Cover chain — a seamless marquee of covers. Horizontal on the mobile band;
   switches to vertical in the desktop column (see the desktop query below). */
.plate__marquee { position: absolute; inset: 0; overflow: hidden; z-index: 0; background: var(--ink-2); }
.plate__track {
  position: absolute; top: 0; left: 0;
  height: 100%;
  display: flex; align-items: stretch;
  will-change: transform; transform: translateZ(0); backface-visibility: hidden;
  animation: marquee-x var(--dur-m, 17s) linear infinite;
  animation-direction: var(--dir-m, normal);
}
.plate__cover {
  flex: 0 0 auto;
  height: 100%; width: auto; aspect-ratio: 3 / 4; /* fixed box → no reflow before load */
  margin-right: 2px;
  display: block; object-fit: cover;
}
@keyframes marquee-x { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.plate__img,
.plate__video,
.plate__media {
  position: absolute; inset: 0;
  display: block;
  width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  object-fit: cover;
  object-position: var(--focus-m, 50% 40%);
  z-index: 0;
  transform: scale(1.001);
  transition: transform 0.9s var(--ease), filter 0.6s var(--ease);
  filter: saturate(0.96) contrast(1.02);
}
/* Elegant fallback when no image is set yet */
.plate__placeholder {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(194,161,90,0.10), transparent 60%),
    linear-gradient(160deg, #17171b, #0d0d10);
}
/* Contrast-guaranteed scrim so bone type never fails against a bright frame */
.plate__scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(8,8,10,0.80) 0%, rgba(8,8,10,0.34) 44%, rgba(8,8,10,0.06) 100%),
    linear-gradient(0deg, rgba(8,8,10,0.52) 0%, rgba(8,8,10,0.0) 52%);
}
.plate__body {
  position: absolute; inset: 0; z-index: 3;
  display: grid; align-content: end;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px 16px;
  padding: clamp(22px, 3.4vw, 40px);
}
.plate__code {
  display: inline-block;
  margin: 0 0 10px;
  font: 600 11px/1 var(--font-ui);
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--brass);
}
.plate__text { grid-column: 1; }
.plate__label {
  display: block;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.01em;
}
.plate__desc {
  display: block;
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 1.6vw, 1.28rem);
  color: var(--bone-dim);
}
.plate__go {
  grid-column: 2; align-self: end;
  display: inline-flex; align-items: center;
  color: var(--bone);
}
.plate__go svg { transition: transform 0.45s var(--ease); }
.plate__go .label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

/* Hover / focus behaviour (gated by reduced-motion below) */
.plate:hover .plate__img,
.plate:hover .plate__video,
.plate:hover .plate__media,
.plate:focus-visible .plate__img,
.plate:focus-visible .plate__video,
.plate:focus-visible .plate__media { transform: scale(1.045); filter: saturate(1) contrast(1.06); }
.plate:hover .plate__go svg,
.plate:focus-visible .plate__go svg { transform: translateX(6px); }
.plate:focus-visible { outline: 2px solid var(--brass); outline-offset: -3px; }

/* ---------------------------------------------------------------------------
   Clients — quiet credibility line for cold buyers
--------------------------------------------------------------------------- */
.clients {
  border-top: 1px solid var(--line);
  padding-block: clamp(28px, 4vw, 44px);
}
.clients__label {
  margin: 0 0 18px;
  font: 600 11px/1 var(--font-ui);
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--bone-faint);
}
.clients__list {
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  list-style: none; margin: 0; padding: 0;
}
.clients__list li {
  font: 600 13px/1 var(--font-ui);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bone-dim);
}

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--line-soft);
  padding-block: clamp(26px, 3vw, 40px) clamp(34px, 4vw, 52px);
  display: flex; flex-wrap: wrap; gap: 12px 28px;
  align-items: baseline; justify-content: space-between;
}
.site-foot a, .site-foot span {
  font: 500 13px/1.4 var(--font-ui);
  letter-spacing: 0.04em;
  color: var(--bone-dim);
}
.site-foot a:hover { color: var(--bone); }
.site-foot .brass { color: var(--brass); }

/* ---------------------------------------------------------------------------
   Motion / responsive
--------------------------------------------------------------------------- */
@media (min-width: 720px) {
  .plate__body { padding-inline: clamp(40px, 5vw, 64px); }
}

/* Desktop: the gate resolves in a single viewport — three full-height columns
   side by side, no scroll. Landscape stacking is a mobile pattern only. */
@media (min-width: 900px) {
  body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
  #main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }

  .hero { padding-block: clamp(16px, 2.2vw, 30px) clamp(10px, 1.4vw, 18px); }
  .hero__title { font-size: clamp(2.3rem, 3.3vw, 3.3rem); }
  .hero__title br { display: none; } /* one line on desktop, reclaim height */

  .plates {
    flex: 1 1 auto; min-height: 0;
    display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr;
    gap: clamp(12px, 1.1vw, 18px);
    padding-bottom: clamp(16px, 2vw, 28px);
  }
  .plate { min-height: 0; height: 100%; margin-top: 0; }

  /* Show the portrait view; apply the desktop focal point. */
  .plate__view--m { display: none; }
  .plate__view--d { display: block; }
  .plate__img, .plate__video, .plate__media { object-position: var(--focus-d, 50% 28%); }

  /* Cover chain runs vertically in the tall column. */
  .plate__track {
    height: auto; width: 100%;
    flex-direction: column;
    animation-name: marquee-y; animation-duration: var(--dur-d, 25s); animation-direction: var(--dir-d, reverse);
  }
  .plate__cover { width: 100%; height: auto; aspect-ratio: 3 / 4; margin: 0 0 2px; }

  /* Column scrim reads bottom-heavy where the label sits. */
  .plate__scrim {
    background:
      linear-gradient(0deg, rgba(8,8,10,0.88) 0%, rgba(8,8,10,0.20) 44%, rgba(8,8,10,0.02) 72%),
      linear-gradient(90deg, rgba(8,8,10,0.28) 0%, rgba(8,8,10,0) 55%);
  }
  .plate__body { grid-template-columns: 1fr auto; padding: clamp(22px, 1.9vw, 34px); }
  .plate__label { font-size: clamp(1.6rem, 2vw, 2.15rem); }
  .plate__desc  { font-size: clamp(0.98rem, 1.05vw, 1.16rem); }

  /* Slim the secondary rows so the columns own the viewport. */
  .clients { padding-block: clamp(16px, 1.6vw, 24px); }
  .site-foot { padding-block: clamp(14px, 1.4vw, 20px) clamp(18px, 1.6vw, 26px); }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plate__img, .plate__video, .plate__media, .plate__go svg { transition: none !important; }
  .plate__track { animation: none !important; }
}
