/* ============================================================
   YUUKI — bedside sleep device
   Dark, quiet, material. Restraint over decoration.
   ============================================================ */

:root {
  /* ground */
  --ink:        #0A0C0F;
  --ink-raised: #10141A;
  --ink-sunk:   #070809;

  /* type */
  --paper:      #EDE8DF;
  --paper-dim:  #A8A49C;
  --paper-faint:#87837C;

  /* the ramp — deep red at W−30 through to 480nm cyan at W */
  --ember:  #C4301E;
  --violet: #6B3FA0;
  --blue:   #2E5BD8;
  --cyan:   #3FD0E0;

  /* the breach cue */
  --amber:  #E0913A;

  --line:       rgba(237, 232, 223, 0.13);
  --line-faint: rgba(237, 232, 223, 0.07);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(1.03rem, 0.98rem + 0.25vw, 1.15rem);
  line-height: 1.62;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- primitives ---------- */

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

.col { max-width: var(--measure); }

h1, h2, h3 {
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -0.018em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

.label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin: 0 0 1.6rem;
  display: block;
}

.dim { color: var(--paper-dim); }

.lede {
  font-size: clamp(1.16rem, 1.05rem + 0.5vw, 1.4rem);
  line-height: 1.5;
  color: var(--paper-dim);
}

section {
  padding-block: clamp(4.5rem, 10vw, 8rem);
  border-top: 1px solid var(--line-faint);
}

.section-head { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }

.section-head h2 {
  font-size: clamp(1.75rem, 1.35rem + 1.9vw, 2.85rem);
}

.section-head .lede { margin-top: 1.1rem; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-faint);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.25rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-decoration: none;
  color: var(--paper);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--paper-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav a:hover { color: var(--paper); }

.site-nav__cta {
  color: var(--paper) !important;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.55em 1.1em;
}

.site-nav__cta:hover { border-color: var(--paper-dim); }

@media (max-width: 46rem) {
  .site-nav__link { display: none; }
}

/* ---------- hero ---------- */

.hero {
  border-top: 0;
  padding-block: clamp(5rem, 12vw, 9.5rem) clamp(4rem, 9vw, 7rem);
  position: relative;
  overflow: hidden;
}

/* the light the device actually throws — one soft wash, not a decoration */
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 90%;
  background:
    radial-gradient(58% 62% at 74% 22%, rgba(224, 145, 58, 0.13), transparent 72%),
    radial-gradient(46% 54% at 22% 8%, rgba(46, 91, 216, 0.10), transparent 74%);
  pointer-events: none;
}

.hero > * { position: relative; }

.hero h1 {
  font-size: clamp(2.35rem, 1.5rem + 4.1vw, 4.6rem);
  max-width: 22ch;
}

.hero h1 em {
  font-style: italic;
  color: var(--amber);
}

.hero .lede {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 52ch;
}

.hero__meta {
  margin-top: 2.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

.hero__meta span { display: flex; align-items: center; gap: 0.55rem; }

.hero__meta span::before {
  content: "";
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--paper-faint);
}

/* ---------- signup ---------- */

.signup { margin-top: clamp(2.25rem, 4vw, 3rem); max-width: 30rem; }

.signup__row { display: flex; gap: 0.5rem; }

.signup input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--paper);
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.95em 1em;
  transition: border-color 0.2s;
}

.signup input[type="email"]::placeholder { color: var(--paper-faint); }

.signup input[type="email"]:focus {
  outline: none;
  border-color: var(--amber);
}

.signup button {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--paper);
  border-radius: 2px;
  padding: 0 1.5em;
  cursor: pointer;
  transition: opacity 0.2s;
}

.signup button:hover { opacity: 0.85; }
.signup button:disabled { opacity: 0.5; cursor: default; }

.signup__note {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--paper-faint);
}

.signup__status {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--amber);
  min-height: 1.2em;
}

/* honeypot */
.signup__trap {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- two moments ---------- */

.moments {
  display: grid;
  gap: 1px;
  background: var(--line-faint);
  border: 1px solid var(--line-faint);
}

@media (min-width: 48rem) {
  .moments { grid-template-columns: 1fr 1fr; }
}

.moment {
  background: var(--ink);
  padding: clamp(1.75rem, 4vw, 2.75rem);
}

.moment__time {
  font-family: var(--mono);
  font-size: 2.1rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.moment--night .moment__time { color: var(--amber); }
.moment--dawn  .moment__time { color: var(--cyan); }

.moment__tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin-bottom: 1.5rem;
}

.moment h3 {
  font-size: 1.3rem;
  margin-bottom: 0.9rem;
}

.moment p { color: var(--paper-dim); font-size: 0.98rem; }

/* the amber pulse, at the rate the device actually breathes */
.pulse {
  width: 100%;
  height: 2px;
  margin-bottom: 1.75rem;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  opacity: 0.35;
  animation: breathe 3.4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.14; }
  50%      { opacity: 0.7; }
}

.moment--dawn .pulse {
  background: linear-gradient(90deg, var(--ember), var(--violet), var(--blue), var(--cyan));
  opacity: 0.8;
  animation: none;
}

/* ---------- ramp figure ---------- */

.figure { margin: clamp(2.5rem, 5vw, 3.5rem) 0 0; }

.figure svg { display: block; width: 100%; height: auto; }

.figure figcaption {
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--paper-faint);
  max-width: 44rem;
}

/* ---------- spec / schedule tables ---------- */

.table-scroll { overflow-x: auto; margin-top: 2rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  text-align: left;
}

th {
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-faint);
  padding: 0 1.5rem 0.85rem 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 0.95rem 1.5rem 0.95rem 0;
  border-bottom: 1px solid var(--line-faint);
  vertical-align: top;
  color: var(--paper-dim);
}

td:first-child { color: var(--paper); white-space: nowrap; }
th:last-child, td:last-child { padding-right: 0; }

/* ---------- prose blocks ---------- */

.prose-grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
}

@media (min-width: 54rem) {
  .prose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.prose-grid h3 {
  font-size: 1.32rem;
  margin-bottom: 0.85rem;
}

.prose-grid p { color: var(--paper-dim); }

/* ---------- the honest list ---------- */

.claims { list-style: none; margin: 0; padding: 0; }

.claims li {
  border-top: 1px solid var(--line-faint);
  padding: 1.15rem 0 1.15rem 2.35rem;
  position: relative;
  color: var(--paper-dim);
}

.claims li:last-child { border-bottom: 1px solid var(--line-faint); }

.claims li::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 1.15rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ember);
}

.claims strong { color: var(--paper); font-weight: 500; }

/* ---------- pull ---------- */

.pull {
  border-left: 2px solid var(--amber);
  padding-left: clamp(1.25rem, 3vw, 2rem);
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  font-size: clamp(1.18rem, 1.05rem + 0.55vw, 1.5rem);
  line-height: 1.44;
  max-width: 38ch;
}

/* ---------- references ---------- */

.refs { list-style: none; margin: 0; padding: 0; }

.refs li {
  padding: 1.35rem 0;
  border-top: 1px solid var(--line-faint);
  font-size: 0.94rem;
  color: var(--paper-dim);
  max-width: 52rem;
}

.refs li:last-child { border-bottom: 1px solid var(--line-faint); }

.refs cite { font-style: normal; color: var(--paper); }

.refs em { color: var(--paper-dim); }

.refs a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--paper-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  word-break: break-word;
}

.refs a:hover { color: var(--paper); }

.refs__gap {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.88rem;
  color: var(--paper-faint);
}

.refs__gap b { font-weight: 500; color: var(--paper-dim); }

/* ---------- closing ---------- */

.closing { text-align: center; }
.closing .col { margin-inline: auto; }
.closing .signup { margin-inline: auto; }
.closing .signup__note { text-align: left; }

.closing h2 { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 3.1rem); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-faint);
  padding-block: 3rem 4rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--paper-faint);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: baseline;
}

.site-footer a { color: var(--paper-dim); text-decoration: none; }
.site-footer a:hover { color: var(--paper); }

/* ---------- consent ---------- */

.consent {
  position: fixed;
  z-index: 100;
  left: 0; right: 0; bottom: 0;
  background: color-mix(in srgb, var(--ink-raised) 96%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  animation: consentIn 0.35s ease both;
}

@keyframes consentIn {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.consent__inner {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding: 1.5rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2.5rem;
}

.consent__text {
  flex: 1 1 24rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: var(--paper-dim);
  margin: 0;
  max-width: 62ch;
}

.consent__actions {
  display: flex;
  gap: 0.6rem;
  flex: 0 0 auto;
}

.consent__btn {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.85em 1.3em;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}

.consent__btn:hover { border-color: var(--paper-dim); }

.consent__btn--yes {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--paper);
}

.consent__btn--yes:hover { opacity: 0.85; border-color: var(--paper); }

@media (max-width: 34rem) {
  .consent__actions { width: 100%; }
  .consent__btn { flex: 1 1 0; padding-inline: 0.75em; }
}

/* a button that has to read as a footer link */
.linklike {
  font: inherit;
  color: var(--paper-dim);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}

.linklike:hover { color: var(--paper); text-decoration-color: currentColor; }
