/* The Second Sleep — Barney Haas
   Single-page site. Palette taken from the window photograph. */

/* ---------- fonts (self-hosted, no third-party requests) ---------- */
@font-face { font-family: Fraunces; font-style: normal; font-weight: 300;
  src: url(../fonts/fraunces-latin-300-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Fraunces; font-style: normal; font-weight: 400;
  src: url(../fonts/fraunces-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Karla; font-style: normal; font-weight: 400;
  src: url(../fonts/karla-latin-400-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Karla; font-style: normal; font-weight: 600;
  src: url(../fonts/karla-latin-600-normal.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Karla; font-style: normal; font-weight: 700;
  src: url(../fonts/karla-latin-700-normal.woff2) format('woff2'); font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --paper:      #F7F3ED;
  --pale:       #E7F1F4;
  --deep:       #075E80;
  --sea:        #0083B5;
  --ink:        #0E2029;
  --ink-soft:   #44606B;
  --stone:      #DFC4B1;
  --chip:       #EDE7DE;
  --chip-line:  #D8CFC2;
  --night:      #0A1A22;
  --night-txt:  #9FB3BC;
  --night-dim:  #8FA6AF;
  --on-deep:    #CFE4EC;
  --field-line: #C2D5DC;

  --serif: Fraunces, Georgia, 'Times New Roman', serif;
  --sans:  Karla, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --max:  1280px;
  --gut:  clamp(20px, 5.6vw, 72px);   /* side gutter */
  --sp:   clamp(56px, 7.4vw, 95px);   /* section padding, top and bottom */

  /* Left inset for full-bleed bands, so their text lines up with the
     contained sections above and below on wide screens. */
  --edge: max(var(--gut), calc((100vw - var(--max)) / 2 + var(--gut)));
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
/* <picture> is inline by default, which collapses any img sized as a
   percentage of it. Every image on this page sits inside one. */
picture { display: block; }
.hero picture, .about picture, .door picture { height: 100%; }
p   { margin: 0; }
figure, blockquote { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; }

a { color: var(--deep); }
a:hover { color: var(--sea); }

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

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

.skip {
  position: absolute; left: -9999px;
  background: var(--deep); color: var(--paper);
  padding: 12px 20px; z-index: 10;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- band backgrounds ---------- */
.band        { padding-block: var(--sp); }
.band--pale  { background: var(--pale); }
.band--night { background: var(--night); }
.band--deep  { background: var(--deep); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  padding: 18px 36px;
  border: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.btn--primary { background: var(--deep);  color: var(--paper); }
.btn--primary:hover { background: #064d69; color: var(--paper); }
.btn--stone   { background: var(--stone); color: var(--ink); font-weight: 700; font-size: 1.125rem; padding: 20px 44px; }
.btn--stone:hover { background: #d4b49d; color: var(--ink); }

/* ---------- header ---------- */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 76px; padding-block: 14px;
}
.wordmark {
  font-size: .75rem; font-weight: 700; letter-spacing: 2.4px;
  text-transform: uppercase; color: var(--deep); text-decoration: none;
}
.site-head__cta { font-size: .875rem; font-weight: 600; color: var(--deep); text-decoration: none; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1fr 562px; align-items: stretch; }
.hero__text {
  display: flex; flex-direction: column; justify-content: center; gap: 30px;
  padding: clamp(48px, 6vw, 72px) clamp(20px, 4vw, 68px) clamp(48px, 6vw, 72px) var(--edge);
}
.hero h1 { font-size: clamp(2.75rem, 6.1vw, 4.875rem); line-height: .99; }
.hero__sub {
  font-family: var(--serif); font-weight: 300; color: var(--deep);
  font-size: clamp(1.35rem, 2.45vw, 1.9375rem); line-height: 1.34;
}
.hero .btn { align-self: flex-start; margin-top: 10px; }
.hero__img { width: 100%; height: 100%; min-height: 610px; object-fit: cover; }

/* ---------- centred lead band ---------- */
.lead { max-width: 880px; margin-inline: auto; text-align: center; display: grid; gap: 28px; justify-items: center; }
.lead__big { font-family: var(--serif); font-weight: 300; font-size: clamp(1.6rem, 3.15vw, 2.5rem); line-height: 1.3; }
.lead__sub { font-size: clamp(1rem, 1.5vw, 1.1875rem); line-height: 1.7; color: var(--ink-soft); max-width: 640px; }

/* ---------- the list of things tried ---------- */
.tried { display: grid; gap: 40px; justify-items: center; text-align: center; }
.tried h2 { font-size: clamp(1.9rem, 3.5vw, 2.75rem); line-height: 1.16; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 1000px; }
.chip {
  border: 1px solid var(--chip-line); background: var(--chip); color: var(--ink-soft);
  font-size: clamp(.875rem, 1.2vw, 1rem); padding: 11px 20px; border-radius: 999px;
}
.tried__close {
  font-family: var(--serif); font-weight: 300; color: var(--deep);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem); line-height: 1.42; max-width: 700px;
}

/* ---------- two-column text block ---------- */
.split { display: grid; grid-template-columns: 360px 1fr; gap: 80px; align-items: start; }
.split h2 { font-size: clamp(1.9rem, 3.6vw, 2.875rem); line-height: 1.1; }

.ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 18px; }
.ticks li { display: flex; gap: 14px; align-items: flex-start; }
.ticks svg { flex-shrink: 0; margin-top: 5px; }
.ticks span { font-size: clamp(1rem, 1.5vw, 1.1875rem); line-height: 1.58; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 520px 1fr; gap: 72px; align-items: stretch; }
.about__img { width: 100%; height: 100%; object-fit: cover; }
.about__text { display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.about h2 { font-size: clamp(2.25rem, 4.4vw, 3.5rem); line-height: 1.04; }
.about__deck {
  font-family: var(--serif); font-weight: 300; color: var(--deep);
  font-size: clamp(1.25rem, 1.95vw, 1.5625rem); line-height: 1.4;
}
.about p:not(.about__deck) { font-size: clamp(1rem, 1.4vw, 1.125rem); line-height: 1.74; color: var(--ink-soft); }

/* ---------- full-bleed photo band ---------- */
.bleed { width: 100%; height: clamp(220px, 36vw, 460px); object-fit: cover; }

/* ---------- numbers ---------- */
.numbers { border-top: 2px solid rgba(223, 196, 177, .45); }
.numbers__head { font-family: var(--serif); font-weight: 300; color: var(--paper);
  font-size: clamp(1.5rem, 2.7vw, 2.125rem); line-height: 1.24; margin-bottom: 52px; }
.numbers__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.numbers__fig { font-family: var(--serif); font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1; color: var(--stone); margin-bottom: 12px; }
.numbers__cap { font-size: clamp(.9375rem, 1.3vw, 1.0625rem); line-height: 1.6; color: var(--night-txt); }

/* ---------- the turn ---------- */
.turn { display: grid; gap: 36px; justify-items: center; }
.turn > * { width: min(860px, 100%); }
.turn h2 { font-size: clamp(1.9rem, 3.5vw, 2.75rem); line-height: 1.14; }
.turn__group { display: grid; gap: 28px; }
.turn p { font-size: clamp(1rem, 1.5vw, 1.1875rem); line-height: 1.74; color: var(--ink-soft); }
.pullquote {
  background: var(--pale); border-left: 4px solid var(--sea);
  padding: clamp(28px, 4vw, 40px) clamp(24px, 4vw, 48px);
}
.pullquote p {
  font-family: var(--serif); font-weight: 300; color: var(--ink);
  font-size: clamp(1.4rem, 2.7vw, 2.125rem); line-height: 1.32;
}
.turn__close {
  font-family: var(--serif); font-weight: 300; color: var(--deep);
  font-size: clamp(1.35rem, 2.4vw, 1.875rem); line-height: 1.34;
}

/* video */
.video { display: grid; gap: 18px; }
.video__link { position: relative; display: block; text-decoration: none; }
.video__link img { width: 100%; aspect-ratio: 860 / 350; object-fit: cover; }
.video__play {
  position: absolute; inset: 0; margin: auto;
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(247, 243, 237, .94);
  box-shadow: 0 2px 16px rgba(14, 32, 41, .35);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.video__link:hover .video__play { transform: scale(1.08); }
.video__tag {
  position: absolute; left: 22px; bottom: 22px;
  background: rgba(14, 32, 41, .84); color: var(--paper);
  font-size: .8125rem; font-weight: 600; letter-spacing: .6px; padding: 8px 14px;
}
.video__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.video__meta p:first-child { font-family: var(--serif); font-weight: 300; color: var(--ink); font-size: clamp(1.25rem, 2.1vw, 1.6875rem); line-height: 1.3; }
.video__caption { color: inherit; text-decoration: none; border-bottom: 1px solid var(--chip-line); }
.video__caption:hover { color: var(--deep); border-bottom-color: var(--deep); }
.video__meta p:last-child { font-size: .9375rem; color: var(--ink-soft); }
.video__frame { display: block; width: 100%; aspect-ratio: 860 / 350; border: 0; }

/* ---------- method ---------- */
.method h2 { font-size: clamp(1.9rem, 3.5vw, 2.75rem); line-height: 1.14; margin-bottom: 44px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.step__num { font-family: var(--serif); font-size: clamp(1.75rem, 2.7vw, 2.125rem); color: var(--sea); margin-bottom: 14px; }
.step h3 { font-size: clamp(1.25rem, 1.9vw, 1.5rem); line-height: 1.26; margin-bottom: 14px; }
.step p { font-size: clamp(.9375rem, 1.35vw, 1.0625rem); line-height: 1.7; color: var(--ink-soft); }

/* ---------- testimonials ---------- */
.quotes h2 { font-size: clamp(1.9rem, 3.5vw, 2.75rem); line-height: 1.14; margin-bottom: 44px; }
.quotes__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; align-items: stretch; }
.quote { background: var(--chip); padding: 34px 30px; display: flex; flex-direction: column; gap: 18px; }
.quote blockquote {
  margin: 0; flex-grow: 1;
  font-family: var(--serif); font-weight: 300; color: var(--ink);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.46;
}
.quote figcaption { display: flex; align-items: center; gap: 12px; }
.quote__avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--chip-line); flex-shrink: 0; object-fit: cover; }
.quote__name { font-size: .9375rem; font-weight: 600; letter-spacing: .3px; color: var(--deep); }

/* ---------- the door ---------- */
.door { background: var(--pale); display: grid; grid-template-columns: 1fr 350px; align-items: stretch; }
.door__text { display: flex; flex-direction: column; justify-content: center; padding: clamp(48px, 6vw, 64px) clamp(20px, 6vw, 80px) clamp(48px, 6vw, 64px) var(--edge); }
.door__text p {
  font-family: var(--serif); font-weight: 300; color: var(--ink);
  font-size: clamp(1.5rem, 2.95vw, 2.375rem); line-height: 1.26; max-width: 660px;
}
.door__img { width: 100%; height: 100%; min-height: 269px; object-fit: cover; }

/* ---------- call to action + form ---------- */
.cta { display: grid; grid-template-columns: 500px 1fr; gap: 72px; align-items: start; }
.cta h2 { font-size: clamp(1.9rem, 3.3vw, 2.625rem); line-height: 1.1; color: var(--paper); }
.cta__col { display: flex; flex-direction: column; gap: 24px; }
.cta__col p { font-size: clamp(1rem, 1.5vw, 1.1875rem); line-height: 1.68; color: var(--on-deep); }
.cta .btn--stone { align-self: flex-start; margin-top: 4px; }
.tip { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.tip p { font-size: .875rem; line-height: 1.6; color: var(--on-deep); }
.tip a { color: var(--paper); }
.tip svg { flex-shrink: 0; }

.form-panel { background: var(--pale); padding: 34px; display: flex; flex-direction: column; gap: 18px; }
.form-panel h3 { font-size: clamp(1.375rem, 2.1vw, 1.625rem); line-height: 1.2; }
.form-panel__intro { font-size: 1rem; line-height: 1.6; color: var(--ink-soft); }
.field-row { display: flex; gap: 18px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 8px; flex: 1 1 180px; }
.field label { font-size: .875rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%; background: var(--paper); border: 1px solid var(--field-line);
  padding: 14px 16px; font-family: var(--sans); font-size: 1rem; color: var(--ink);
}
.field textarea { height: 92px; line-height: 1.6; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--deep); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .8125rem; line-height: 1.5; color: var(--ink-soft); }
.form-msg { font-size: 1rem; line-height: 1.6; padding: 14px 16px; }
.form-msg[data-state="ok"]   { background: #D9EBD9; color: #1D4420; }
.form-msg[data-state="fail"] { background: #F3DADA; color: #6B1F1F; }
[hidden] { display: none !important; }

/* ---------- footer ---------- */
.site-foot { background: var(--night); padding-block: 48px; }
.site-foot__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 64px; flex-wrap: wrap; margin-bottom: 34px; }
.site-foot .wordmark { color: var(--stone); }
.site-foot__blurb { font-size: 1rem; line-height: 1.6; color: var(--night-txt); max-width: 420px; margin-top: 12px; }
.site-foot__label { font-size: .75rem; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--night-dim); margin-bottom: 12px; }
.site-foot__links a { display: block; font-size: 1rem; color: var(--paper); text-decoration: none; }
.site-foot__links a:hover { color: var(--stone); }
.site-foot__bar { border-top: 1px solid #1E3038; padding-top: 24px; display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.site-foot__bar p, .site-foot__bar a { font-size: .875rem; color: var(--night-dim); }

/* ---------- simple inner pages ---------- */
.page { max-width: 760px; margin-inline: auto; padding-block: var(--sp); }
.page h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; margin-bottom: 28px; }
.page h2 { font-size: clamp(1.25rem, 2.2vw, 1.5rem); margin: 36px 0 12px; }
.page p, .page li { font-size: 1.0625rem; line-height: 1.75; color: var(--ink-soft); margin-bottom: 14px; }
.page .back { display: inline-block; margin-top: 32px; font-weight: 600; }

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .hero__text { padding-inline: var(--gut); }
  .hero__img { min-height: clamp(280px, 48vw, 460px); }

  .split { grid-template-columns: 1fr; gap: 32px; }
  .about { grid-template-columns: 1fr; gap: 36px; }
  .about__img { max-height: 520px; }
  .steps { grid-template-columns: 1fr 1fr; gap: 32px; }
  .quotes__grid { grid-template-columns: 1fr 1fr; }
  .cta { grid-template-columns: 1fr; gap: 40px; }
  .door { grid-template-columns: 1fr; }
  .door__img { min-height: 0; height: clamp(200px, 40vw, 300px); }
  .door__text { padding-inline: var(--gut); }
}

/* ---------- phone ---------- */
@media (max-width: 680px) {
  .site-head { min-height: 64px; }
  .hero__img { min-height: 440px; }
  .site-head__cta { display: none; }

  .numbers__grid { grid-template-columns: 1fr; gap: 36px; }
  .numbers__head { margin-bottom: 36px; }
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .quotes__grid { grid-template-columns: 1fr; gap: 20px; }

  .hero .btn, .cta .btn--stone { align-self: stretch; text-align: center; }
  .btn { padding: 16px 28px; }

  .video__play { width: 56px; height: 56px; }
  .video__play svg { width: 22px; height: 22px; }
  .video__tag { left: 12px; bottom: 12px; font-size: .6875rem; padding: 6px 10px; }

  .form-panel { padding: 24px; }
  .field-row { gap: 14px; }
  .field { flex-basis: 100%; }

  .site-foot__top { gap: 32px; }
}

/* ---------- motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-head__cta, .video, .form-panel { display: none; }
  body { background: #fff; color: #000; }
}
