/* LeftEarly.Co. Tokens come straight from DESIGN.md. Mobile first. */

:root {
  --ink: #2B2B2B;
  --paper: #FAFAF7;
  --card: #FFFFFF;
  --quiet: #6B6B66;
  --line: #E6E6E1;
  --mint: #5FE3C4;
  --lemon: #FFE94D;
  --ember: #EB5F35;
  --on-accent: #1E1E1E;
  --tint: #F3F3EE;
  --cta-bg: #2B2B2B;
  --cta-text: #FAFAF7;
  --font-head: 'Alegreya', Georgia, serif;
  --font-body: 'Quicksand', 'Nunito', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --gutter: 20px;
  --header-h: 56px;
  --section-pad: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #FAFAF7;
    --paper: #1E1E1E;
    --card: #2A2A2A;
    --quiet: #A3A39D;
    --line: #3A3A3A;
    --tint: #232323;
    --cta-bg: #2A2A2A;
  }
}

:root[data-theme="dark"] {
  --ink: #FAFAF7;
  --paper: #1E1E1E;
  --card: #2A2A2A;
  --quiet: #A3A39D;
  --line: #3A3A3A;
  --tint: #232323;
  --cta-bg: #2A2A2A;
}

@media (min-width: 641px) {
  :root { --gutter: 32px; --header-h: 64px; --section-pad: 88px; }
}

@media (min-width: 1025px) {
  :root { --gutter: 40px; --header-h: 72px; --section-pad: 112px; }
}

/* Base */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (min-width: 1025px) {
  body { font-size: 17px; }
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
p + p { margin-top: 16px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 700; }
svg { display: block; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Highlight: a thick lemon underline that sits just under the word, like a marker stroke. */
mark {
  position: relative;
  isolation: isolate;
  background: none;
  color: inherit;
  white-space: nowrap;
}

mark::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.04em;
  right: -0.04em;
  bottom: 0.02em;
  height: 0.2em;
  border-radius: 999px;
  background: var(--lemon);
  transform-origin: left center;
}

/* In the hero, the underline draws itself in just after the page appears. */
@media (prefers-reduced-motion: no-preference) {
  h1 mark::after { animation: underline-draw 0.6s cubic-bezier(0.22, 0.8, 0.3, 1) 0.4s both; }
}

@keyframes underline-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--mint);
  color: var(--on-accent);
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: calc(1120px + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.narrow { max-width: calc(760px + var(--gutter) * 2); }

/* Buttons and links */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-primary {
  background: var(--mint);
  color: var(--on-accent);
}

.btn-primary:hover { background: #79E9CF; }
.btn-primary:active { transform: translateY(1px); }

.btn-small {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 15px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
.text-link:hover { text-decoration-color: var(--mint); text-decoration-thickness: 3px; }

/* Header */

.scroll-sentinel {
  position: absolute;
  top: 0;
  height: 1px;
  width: 1px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.header-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 6px;
}

.logo {
  width: auto;
  height: 30px;
}

@media (min-width: 1025px) {
  .logo { height: 36px; }
}

.logo-ink, .door-frame { fill: var(--ink); }
.logo-mint, .door-panel { fill: var(--mint); }

.header-cta { transition: opacity 0.2s ease, visibility 0.2s; }

/* Sections */

.section { padding: var(--section-pad) 0; }
.section-tinted { background: var(--tint); }

h2 {
  font-size: 28px;
  margin-bottom: 32px;
}

h3 { font-size: 22px; line-height: 1.2; }

@media (min-width: 1025px) {
  h2 { font-size: 36px; margin-bottom: 48px; }
  h3 { font-size: 24px; }
}

.section-intro { max-width: 680px; margin-bottom: 32px; }
.section-intro h2 { margin-bottom: 16px; }
.section-intro p { color: var(--quiet); font-size: 1.0625em; }

@media (min-width: 1025px) {
  .section-intro { margin-bottom: 48px; }
}

/* Hero */

.hero { padding: 24px 0 var(--section-pad); }

/* "Your day" card: an example workday that frees up when the visitor presses the button.
   main.js draws the blocks: down the card on phones and tablets, across it from 900px. */

.day-card {
  max-width: 880px;
  margin: 0 auto;
  padding: 18px 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.day-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.day-card-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
}

.day-card-tag { font-size: 13px; color: var(--quiet); }

.day { position: relative; }
.day.is-tall { height: 290px; margin-left: 40px; }
.day.is-wide { height: 128px; }

.day-hour-line {
  position: absolute;
  border: 0 solid var(--line);
}
.day.is-tall .day-hour-line { left: 0; right: 0; border-top-width: 1px; }
.day.is-wide .day-hour-line { top: 18px; bottom: 0; border-left-width: 1px; }

.day-hour {
  position: absolute;
  font-size: 12px;
  line-height: 1;
  color: var(--quiet);
  white-space: nowrap;
}
.day.is-tall .day-hour { left: -40px; transform: translateY(-50%); }
.day.is-wide .day-hour { top: 0; transform: translateX(4px); }

.day-block,
.day-life {
  position: absolute;
  display: flex;
  align-items: center;
  padding: 0 8px;
  overflow: hidden;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.day-block {
  transition: top 0.9s ease, height 0.9s ease, left 0.9s ease, width 0.9s ease, background-color 0.6s, color 0.4s;
}
.day-block.is-work { background: var(--ink); color: var(--paper); }
.day-block.is-admin { background: var(--ember); color: var(--on-accent); }
/* On autopilot the blocks shrink to slivers, so their labels fade out. */
.day-block.is-auto { background: var(--mint); color: transparent; }

.day-free {
  position: absolute;
  border: 1.5px dashed var(--ink);
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.6s 0.4s;
}

.day-life {
  background: var(--card);
  border: 1.5px solid var(--mint);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s, transform 0.5s;
}

.day-lane-label {
  position: absolute;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.5s 0.6s;
}

.day.is-on .day-free,
.day.is-on .day-lane-label { opacity: 1; }
.day.is-on .day-life { opacity: 1; transform: none; }

.day-status {
  margin-top: 14px;
  font-size: 15px;
  text-align: center;
}

.day-status b { font-weight: 700; }

/* Hidden but holding its space, so nothing below jumps when it appears. */
.day-next {
  display: block;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.5s;
}
.day-next.is-shown { opacity: 1; }

.day-play-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.day-play {
  width: 100%;
  max-width: 360px;
  min-height: 52px;
  padding: 12px 24px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--lemon);
  color: var(--on-accent);
  font: 700 16px/1.3 var(--font-body);
  cursor: pointer;
  transition: transform 0.15s;
}
.day-play:active { transform: scale(0.97); }
.day-play.is-done { background: transparent; color: var(--ink); }

/* The little hand that taps the button until someone presses it. Sits near the button's right end. */
.day-pointer {
  position: absolute;
  left: calc(50% + min(50%, 180px) - 34px);
  top: calc(100% - 20px);
  width: 26px;
  height: 26px;
  pointer-events: none;
}
.day-pointer.is-gone { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .day-play.is-cued { animation: ring 2.2s ease-out infinite; }
  .day-pointer { animation: tap 2.2s ease-in-out infinite; }
  .hero-actions .btn.is-cued { animation: ring 2.2s ease-out 3; }
}

@media (prefers-reduced-motion: reduce) {
  .day-pointer { display: none; }
}

@keyframes ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 40%, transparent); }
  70%, 100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--ink) 0%, transparent); }
}

@keyframes tap {
  0%, 100% { transform: translate(12px, 12px); }
  40%, 60% { transform: translate(0, 0); }
  50% { transform: translate(0, 0) scale(0.85); }
}

@media (min-width: 900px) {
  .day-card { padding: 24px 28px 28px; }
}

/* Hero words: the headline sits above the card, the rest centred under it */

.hero-copy {
  max-width: 680px;
  margin: 40px auto 0;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--quiet);
}

h1 {
  max-width: 680px;
  margin: 0 auto 24px;
  font-size: 40px;
  line-height: 1.05;
  text-align: center;
}

.hero-sub {
  max-width: 560px;
  margin: 20px auto 0;
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 32px;
}

.hero-actions .btn { width: 100%; }

.reassurance {
  margin-top: 12px;
  font-size: 14px;
  color: var(--quiet);
  text-wrap: balance;
}

@media (min-width: 641px) {
  .hero { padding-top: 48px; }
  h1 { font-size: 52px; margin-bottom: 32px; }
  .hero-actions { flex-direction: row; justify-content: center; gap: 20px; }
  .hero-actions .btn { width: auto; }
}

@media (min-width: 1025px) {
  .hero { padding: 64px 0 var(--section-pad); }
  .hero-copy { margin-top: 56px; }
  h1 { font-size: 64px; margin-bottom: 40px; }
  .hero-sub { font-size: 19px; margin-top: 24px; }
  .hero-actions { margin-top: 40px; }
}

/* Sound familiar */

.pain-list li {
  position: relative;
  padding: 16px 0 16px 28px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  line-height: 1.5;
}

.pain-list li:first-child { border-top: 1px solid var(--line); }

.pain-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: calc(16px + 0.75em - 5px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ember);
}

.pull-line {
  margin-top: 40px;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

@media (min-width: 1025px) {
  .pain-list li { font-size: 19px; padding: 20px 0 20px 32px; }
  .pain-list li::before { top: calc(20px + 0.75em - 5px); }
  .pull-line { margin-top: 56px; font-size: 40px; }
}

/* How it works */

.steps {
  display: grid;
  gap: 40px;
  counter-reset: none;
}

.step-number {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--on-accent);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 24px;
  line-height: 1;
}

/* Phones and tablets: the number sits beside its heading, the text runs underneath. */
.step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 16px;
  align-items: center;
}

.step-number { margin-bottom: 0; }
.step p { grid-column: 1 / -1; margin-top: 12px; }

@media (min-width: 641px) {
  .step { max-width: 600px; }
}

@media (min-width: 1025px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 48px; }
  .step {
    display: block;
    position: relative;
    padding-top: 0;
  }
  .step-number { margin-bottom: 20px; }
  .step h3 { margin-bottom: 12px; }
  .step p { margin-top: 0; }
  /* A thin line joins the three numbers into one journey. */
  .step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 24px;
    left: 64px;
    right: -32px;
    height: 1px;
    background: var(--line);
  }
}

/* Before and after cards */

.cards {
  display: grid;
  gap: 16px;
}

.card {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card h3 { margin-bottom: 20px; }

.ba {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

.ba + .ba {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--on-accent);
}

.tag-before { background: var(--ember); }
.tag-after { background: var(--mint); }

@media (min-width: 641px) {
  .cards { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (min-width: 1025px) {
  .cards { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .card { padding: 28px; }
}

/* How I work */

.principles {
  display: grid;
  gap: 32px;
}

.principles li {
  position: relative;
  padding-left: 44px;
}

/* Small mint check, drawn in CSS so it needs no icon file. */
.principles li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mint);
}

.principles li::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 7px;
  width: 6px;
  height: 11px;
  border: solid var(--on-accent);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.principles h3 { margin-bottom: 8px; }

@media (min-width: 1025px) {
  .principles {
    grid-template-columns: repeat(2, 1fr);
    gap: 56px 64px;
  }
  .principles li { padding-left: 48px; }
}

/* Who I am */

/* Stacked and centred on phones and tablets, photo beside the words on desktop. */
.about {
  display: grid;
  gap: 32px;
  justify-items: center;
  justify-content: center;
  text-align: center;
}

.about-photo {
  display: block;
  width: 240px;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--line);
}

.about-copy { max-width: 680px; }
.about-copy h2 { margin-bottom: 24px; }

@media (min-width: 1025px) {
  .about {
    grid-template-columns: 320px minmax(0, 680px);
    gap: 80px;
    align-items: center;
    text-align: left;
  }
  .about-photo { width: 320px; }
}

/* Questions */

.faq { border-top: 1px solid var(--line); }

.faq-item { border-bottom: 1px solid var(--line); }

.faq-item h3 { font-size: inherit; }

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 64px;
  padding: 16px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.faq-icon {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.faq-icon::before, .faq-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease;
}

.faq-icon::after { transform: rotate(90deg); }

.faq-q:hover .faq-icon { border-color: var(--ink); }

.faq-q[aria-expanded="true"] .faq-icon {
  background: var(--mint);
  border-color: var(--mint);
}

.faq-q[aria-expanded="true"] .faq-icon::before,
.faq-q[aria-expanded="true"] .faq-icon::after { background: var(--on-accent); }

.faq-q[aria-expanded="true"] .faq-icon::after { transform: rotate(0deg); }

.faq-a { padding: 0 48px 24px 0; }

.faq-a[hidden] { display: none; }

@media (min-width: 1025px) {
  .faq-q { font-size: 19px; min-height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Final call to action */

.final-cta {
  padding: var(--section-pad) 0;
  background: var(--cta-bg);
  color: var(--cta-text);
  text-align: center;
}

.final-cta h2 {
  margin-bottom: 20px;
  font-size: 36px;
}

.final-cta p {
  max-width: 560px;
  margin: 0 auto;
  font-size: 17px;
}

.final-cta .btn {
  width: 100%;
  margin-top: 32px;
}

.final-cta .cta-email {
  margin-top: 20px;
  font-size: 15px;
  color: #D9D9D3;
}

.final-cta .cta-email a {
  color: var(--mint);
  font-weight: 700;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.final-cta :focus-visible { outline-color: var(--mint); }

@media (min-width: 641px) {
  .final-cta .btn { width: auto; min-width: 240px; }
}

@media (min-width: 1025px) {
  .final-cta h2 { font-size: 56px; }
  .final-cta p { font-size: 19px; }
}

/* Footer */

.site-footer {
  padding: 48px 0;
  font-size: 14px;
  color: var(--quiet);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}

.footer-inner p + p { margin-top: 0; }

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

.footer-brand svg { width: 22px; height: auto; }

.footer-links { display: flex; gap: 20px; }

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-weight: 700;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 1025px) {
  .footer-copy { margin-left: auto; }
}

/* Mobile booking bar: phones only, appears once the hero has scrolled away. */

.mobile-bar { display: none; }

@media (max-width: 640px) {
  .mobile-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--line);
    transform: translateY(110%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s;
  }

  .mobile-bar .btn { width: 100%; }

  .has-bar .mobile-bar {
    transform: translateY(0);
    visibility: visible;
  }

  /* One booking button at a time: the header button steps aside while the bar shows. */
  .has-bar .header-cta { opacity: 0; visibility: hidden; }

  .site-footer { padding-bottom: calc(48px + 70px + env(safe-area-inset-bottom)); }
}

/* Booking page */

.book { padding: 24px 0 var(--section-pad); }

.book-intro { max-width: 680px; }

.book-intro h1 { font-size: 36px; }

.book-sub { margin-top: 16px; font-size: 17px; }

.book-intro .reassurance { text-align: left; }

.booking-card {
  position: relative;
  margin-top: 32px;
  min-height: 560px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal-embed { width: 100%; }

/* The calendar page inside the iframe always declares a light colour scheme, but Cal.com's script
   tags the iframe itself as dark in dark mode. Browsers paint a white box behind an iframe when
   those two disagree, so this pins them together. !important is needed to beat Cal's inline style. */
.cal-embed iframe { color-scheme: light !important; }

.cal-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--quiet);
  text-align: center;
}

.cal-status a,
.book-fallback a {
  color: var(--ink);
  font-weight: 700;
  text-underline-offset: 3px;
}

.booking-card.is-ready .cal-status { display: none; }
.booking-card.is-ready {
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
}
.booking-card.has-problem .cal-embed { display: none; }
.booking-card.has-problem .cal-status { position: static; min-height: 240px; color: var(--ink); }

.book-fallback {
  margin-top: 16px;
  font-size: 14px;
  color: var(--quiet);
}

@media (min-width: 641px) {
  .book { padding-top: 48px; }
  .book-intro h1 { font-size: 48px; }
}

@media (min-width: 1025px) {
  .book { padding-top: 72px; }
  /* Cal.com centres its calendar, so the intro and fallback line centre with it. */
  .book-intro, .book-fallback { margin-left: auto; margin-right: auto; text-align: center; }
  .book-intro .reassurance { text-align: center; }
  .book-intro h1 { font-size: 56px; }
  .book-sub { font-size: 19px; }
  .booking-card { margin-top: 48px; padding: 8px; }
}
