/* Franklin From Philly — hand-written CSS, no framework. */

@font-face {
  font-family: "Fraunces Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/fraunces-soft-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Fraunces Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/fraunces-soft-italic.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/fonts/instrument-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/fonts/instrument-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("/fonts/jetbrains-mono-500.woff2") format("woff2");
}

:root {
  --paper: #F4EFE6;
  --ink: #1B1A17;
  --accent: #E2552B;
  /* Darker orange for small accent TEXT (stamps, labels) on paper: #E2552B on #F4EFE6
     measures ~3.3:1, below AA. This measures ~4.8:1. Buttons keep the brighter --accent. */
  --accent-text: #B8431D;
  --ink-on-accent: #1B1A17; /* used where white-on-accent fails AA */
  --max-w: 1100px;
  --radius: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Instrument Sans", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

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

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(27, 26, 23, 0.35);
  text-decoration-thickness: 1px;
  position: relative;
}
/* §7.1: a second, accent-colored underline that grows in from the left on hover. */
a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 150ms ease;
}
a:hover::after, a:focus-visible::after { width: 100%; }
a.btn::after { display: none; }
@media (prefers-reduced-motion: reduce) { a::after { transition: none; } }

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

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

h1, h2, h3, .wordmark, .footer-wordmark {
  font-family: "Fraunces Variable", Georgia, serif;
  font-variation-settings: "opsz" 40, "SOFT" 40;
  font-weight: 560;
  margin: 0;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stamp {
  color: var(--accent-text);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: "Instrument Sans", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid var(--accent);
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  /* White text on signal orange measures ~3.8:1 — below AA for normal-weight 16px text.
     Ink on orange measures well over 7:1, so ink is the default here, not white. */
  background: var(--accent);
  color: var(--ink-on-accent);
}
.btn-primary:hover, .btn-primary:focus-visible { background: #c8431d; color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--ink);
}
.btn-outline:hover, .btn-outline:focus-visible { background: rgba(226, 85, 43, 0.08); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid rgba(27, 26, 23, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  max-height: 56px;
}
.wordmark {
  font-size: 1.15rem;
  line-height: 1;
  white-space: nowrap;
}
.wordmark em { font-style: italic; }
.site-header .btn {
  padding: 0.4rem 0.9rem;
  min-height: 36px;
  font-size: 0.85rem;
  white-space: nowrap;
  flex: 0 0 auto;
}
.work-btn-short { display: none; }
@media (max-width: 360px) {
  .work-btn-full { display: none; }
  .work-btn-short { display: inline; }
  .site-header .btn { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
}
.header-status {
  color: var(--accent-text);
  white-space: nowrap;
  margin-right: auto;
  margin-left: 1rem;
}
.header-status[hidden] { display: none; }

/* Hero */
.hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  background: var(--paper);
  transition: background-color 400ms ease;
}
.hero.is-playing { background: #EFE3D0; }
@media (prefers-reduced-motion: reduce) { .hero { transition: none; } }

.hero-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #000;
  overflow: hidden;
}
.hero-frame img, .hero-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-frame video { display: none; }
.hero-frame.is-playing img { display: none; }
.hero-frame.is-playing video { display: block; }
/* E1: fallback if playback hasn't started within 3s — native controls appear
   over the still-visible sleeping photo, so a tap can start it. */
.hero-frame.show-fallback video { display: block; }

/* DESIGN_1 §2.4: the sleeping photo breathes, very slowly. Off under reduced motion. */
@keyframes hero-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}
.hero-frame:not(.is-playing) img { animation: hero-breathe 5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  /* Must match (or beat) .hero-frame:not(.is-playing) img's specificity, or this loses. */
  .hero-frame:not(.is-playing) img, .hero-frame img { animation: none; }
}

.hero-video-controls {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 3;
  display: flex;
  gap: 0.5rem;
}
.hero-video-controls[hidden] { display: none; }
.hero-video-controls button {
  min-width: 44px;
  min-height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

/* DESIGN_1 §2.2: the clock chip — a label above a rolling time. Shared with
   each moment's (static) time stamp; .hero-clock adds the roll/color-flip. */
.clock-chip {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  background: var(--paper);
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  transition: background-color 400ms ease, color 400ms ease;
}
.clock-label { opacity: 0.7; font-size: 0.6rem; }
.clock-time { display: flex; font-size: 1rem; letter-spacing: normal; text-transform: none; }
.clock-char-wrap { height: 1.2em; overflow: hidden; line-height: 1.2; }
.clock-char-pair { display: flex; flex-direction: column; transition: transform 400ms ease; }
.clock-char-pair span { height: 1.2em; white-space: pre; }
.clock-chip.is-after .clock-char-pair { transform: translateY(-50%); }
.clock-chip.is-after { background: var(--accent); color: var(--ink-on-accent); }
@media (prefers-reduced-motion: reduce) {
  .clock-char-pair, .clock-chip { transition: none; }
}

.hero-identity {
  margin: 0 0 0.5rem;
  opacity: 0.7;
}
/* Phone: force the break after the breed rather than risk "· PHILADELPHIA"
   wrapping alone onto its own line. Desktop has room for one line (checked). */
.hero-identity-rest { display: block; }
@media (min-width: 900px) {
  .hero-identity-rest { display: inline; }
}

.hero-body {
  padding: 1.5rem 1rem 2rem;
}
.hero-body h1 {
  font-size: clamp(2.3rem, 10.5vw, 3rem);
  line-height: 1.02;
  margin: 0 0 1.25rem;
  max-width: 13ch;
}

@media (min-width: 900px) {
  .hero { display: flex; align-items: center; gap: 2.5rem; padding: 2rem; min-height: 78vh; }
  /* width via min(): flex-basis + max-height fought the aspect-ratio when the
     50%-wide box was taller than 72vh allowed — flex-shrink:0 pinned the width
     anyway, so the box stopped being 4:5. Pre-computing the limiting width
     lets aspect-ratio alone determine height, cleanly, every time. */
  .hero-frame { flex: 0 0 auto; width: min(50%, 57.6vh); aspect-ratio: 4 / 5; border-radius: 4px; }
  .hero-body { flex: 1 1 auto; padding: 0; display: flex; flex-direction: column; justify-content: center; }
  .hero-body h1 { font-size: clamp(3rem, 5.5vw, 5rem); max-width: 18ch; text-wrap: balance; }
}

/* Moments */
.section { max-width: var(--max-w); margin: 0 auto; padding: 3rem 1rem; }
.section h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 0.4rem; }
.eyebrow { color: var(--accent-text); margin: 0 0 0.6rem; }
.section-subheading { opacity: 0.65; margin: 0 0 1.5rem; }

/* DESIGN_1 §3.4: full-bleed media on phone, edge to edge — .section-bleed drops
   the section's own side padding and .section-inset puts it back for text. */
.section-bleed { padding-left: 0; padding-right: 0; }
.section-inset { padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 760px) {
  .section-bleed { padding-left: 1rem; padding-right: 1rem; }
  .section-inset { padding-left: 0; padding-right: 0; }
}

.moments-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 2rem;
}
@media (min-width: 900px) {
  /* DESIGN_1 §3.3: an offset editorial layout, not a uniform grid. Moment 1 is
     large (7/12 cols); the rest stack in the remaining 5, nudged to zigzag. */
  .moments-grid { grid-template-columns: repeat(12, 1fr); gap: 1.5rem; row-gap: 2.25rem; }
  .moment { grid-column: span 5; }
  .moment:first-child { grid-column: 1 / span 8; grid-row: 1 / span 2; }
  .moment:not(:first-child) { grid-column: 9 / span 4; }
  .moment:nth-child(odd):not(:first-child) { margin-left: 1.5rem; }
  /* Only 2 moments: no second side item to stack against, so the large
     item doesn't need (and shouldn't claim) a second row. */
  .moments-grid[data-count="2"] .moment:first-child { grid-row: auto; }
  /* More than 3: a 4th+ moment would either overflow the large item's
     fixed 2-row span (leaving the left column empty beneath it) or need
     a bespoke taller span per count — instead it drops to full width
     below the editorial pair, which never leaves an orphaned gap. */
  .moment:nth-child(n+4) { grid-column: 1 / -1 !important; margin-left: 0; }
}

.moment figure { margin: 0; }
.moment-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #000;
  overflow: hidden;
}
.moment-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.moment-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Phone: edge-to-edge, no rounding (DESIGN_1 §3.4) — captions get their own inset. */
.moment-media { border-radius: 0; }
.moment figcaption { padding: 0 1rem; }
@media (min-width: 760px) {
  .moment-media { border-radius: 4px; }
  .moment figcaption { padding: 0; }
}

.moment-time {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  padding: 0.25rem 0.55rem;
}
.moment-time .clock-time { font-size: 0.8rem; }

/* DESIGN_1 §3.7: reveal on scroll — app.js adds .is-ready up front (so content
   stays visible if JS never runs) then flips .is-visible once in view. */
.moment-reveal.is-ready { opacity: 0; transform: translateY(12px); }
.moment-reveal.is-ready.is-visible { opacity: 1; transform: translateY(0); transition: opacity 500ms ease, transform 500ms ease; }
@media (prefers-reduced-motion: reduce) {
  .moment-reveal.is-ready { opacity: 1; transform: none; }
}

.moment-play {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: none;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.moment-play-icon { width: 13px; height: 13px; flex: 0 0 auto; }
.moment-play-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}
.moment-play[hidden] { display: none; }

figcaption {
  margin-top: 0.75rem;
  font-family: "Fraunces Variable", Georgia, serif;
  font-size: 1.25rem;
  line-height: 1.3;
}
@media (min-width: 900px) {
  figcaption { font-size: 1.4rem; }
}
figcaption .voice-tag {
  display: block;
  margin-bottom: 0.25rem;
}
figcaption:empty { display: none; }

.more-line { margin-top: 2.5rem; font-size: 1rem; }
.social-links { display: flex; gap: 1rem; margin-top: 0.5rem; font-size: 0.9rem; flex-wrap: wrap; }

/* DESIGN_1 §4: the one full-width ink band between Moments and Work. */
.interlude {
  background: var(--ink);
  color: var(--paper);
  padding: 10vh 1rem;
  text-align: center;
}
.interlude-text {
  margin: 0 auto;
  max-width: 22ch;
  font-family: "Fraunces Variable", Georgia, serif;
  font-size: clamp(1.6rem, 3.6vw, 2.8rem);
  line-height: 1.25;
}
.interlude-sig {
  margin: 1.5rem 0 0;
  opacity: 0.7;
}

/* Work section */
.work-grid { display: block; margin-top: 2rem; }
.work-copy p { margin: 0 0 1rem; max-width: 640px; }
.work-copy .work-lead {
  font-family: "Fraunces Variable", Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.35;
  max-width: 34ch;
}
.signature {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: "Fraunces Variable", Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
}
.signature-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }

/* §5.2: the three "What I make / Where it runs / Where we are" lines as a
   mono-label/text spec list, hairlines between rows. */
.spec-list { margin: 1.5rem 0 0; display: block; }
.spec-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid rgba(27, 26, 23, 0.12);
}
.spec-row:last-child { border-bottom: 1px solid rgba(27, 26, 23, 0.12); }
.spec-row dt { color: var(--accent-text); }
.spec-row dd { margin: 0; max-width: 46ch; }

.ideas-heading { margin-top: 2.5rem; }
.idea-cards { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .idea-cards { grid-template-columns: 1fr 1fr; } }

.idea-card {
  border: 1px solid rgba(27, 26, 23, 0.15);
  border-radius: 4px;
  padding: 1.25rem;
}
.idea-label-chip {
  display: inline-block;
  color: var(--accent-text);
  background: rgba(226, 85, 43, 0.08);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.75rem;
}
.idea-card h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.idea-card .idea-for { font-style: italic; margin: 0 0 0.75rem; }
.idea-card .idea-partner { margin-top: 0.75rem; font-size: 0.85rem; }
.idea-sample-media { aspect-ratio: 4 / 5; max-width: 240px; border-radius: 4px; overflow: hidden; margin-bottom: 0.75rem; background: #000; }
.idea-sample-media video, .idea-sample-media img { width: 100%; height: 100%; object-fit: cover; }

/* §5.3: idea cards as storyboards — a time + line per beat. */
.idea-beats { list-style: none; margin: 0; padding: 0; }
.idea-beats li { display: flex; gap: 0.75rem; padding: 0.5rem 0; border-top: 1px solid rgba(27, 26, 23, 0.1); }
.idea-beats li:first-child { border-top: none; }
.idea-beat-time { color: var(--accent-text); flex: 0 0 4.5rem; }

.stats-list { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.stats-list li { font-size: 0.95rem; }
.stats-list .stat-value { font-weight: 600; }

/* §5.1: two columns on desktop — copy/ideas left, a sticky form card right. */
@media (min-width: 900px) {
  .work-grid { display: grid; grid-template-columns: 1fr 23rem; gap: 3rem; align-items: start; }
  .work-form-card { position: sticky; top: 1.5rem; }
}

.work-form-card {
  background: #fff;
  border-radius: 4px;
  padding: 1.75rem;
  margin-top: 2rem;
  box-shadow: 0 1px 3px rgba(27, 26, 23, 0.08);
}
@media (min-width: 900px) { .work-form-card { margin-top: 0; } }

/* Form */
.inquiry-form { max-width: 560px; }
.field { margin-bottom: 1.4rem; }
.field label {
  display: block;
  font-family: "Instrument Sans", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.field input, .field textarea {
  width: 100%;
  font-size: 1rem;
  font-family: inherit;
  padding: 0.9rem 1rem;
  min-height: 52px;
  border: 1px solid rgba(27, 26, 23, 0.3);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 7rem; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}
.field-help { font-size: 0.85rem; opacity: 0.75; margin-top: 0.4rem; }
.honeypot-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-submit-btn { display: flex; gap: 0.5rem; }
.submit-arrow { display: inline-block; transition: transform 150ms ease; }
.form-submit-btn:hover .submit-arrow, .form-submit-btn:focus-visible .submit-arrow { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) { .submit-arrow { transition: none; } }

.form-error {
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  background: rgba(226, 85, 43, 0.06);
}
.form-error p { margin: 0 0 0.5rem; }
.form-error p:last-child { margin-bottom: 0; }

.form-noscript-note {
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1rem;
  margin: 2.5rem 0 0;
  background: rgba(226, 85, 43, 0.06);
}
.form-success {
  font-family: "Fraunces Variable", serif;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.form-success[hidden] { display: none; }
.form-success-thumb { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }

.direct-email { margin-top: 1rem; font-size: 0.95rem; }

/* Footer (§6) */
.site-footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1rem 3rem;
  text-align: center;
}
.footer-wordmark {
  font-size: clamp(3rem, 12vw, 9rem);
  line-height: 0.95;
  margin: 0 0 1.5rem;
}
.footer-wordmark em { font-style: italic; }
.footer-links { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 0.75rem; }
.footer-status { color: var(--accent-text); margin: 0 0 1.5rem; }
.footer-copyright { font-size: 0.8rem; opacity: 0.6; margin: 0; }

/* Placeholder slots (dev only) */
.placeholder-slot {
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 2px dashed var(--ink);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
}
.placeholder-slot pre {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  white-space: pre-wrap;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

#work { scroll-margin-top: 64px; }
