/*
  Hemlock landing page.
  One deliberate look in both light and dark, built from the app's own neutral
  surfaces, near-black action colour and blue focus accent. No framework, no
  build step, no external asset except the Inter webfont.
*/

:root {
  --page: #f5f5f5;
  --surface: #ffffff;
  --surface-sunken: #f1f3f6;
  --line: #dedede;
  --line-soft: #e5e5e5;
  --text: #171717;
  --text-muted: #414141;
  --text-quiet: #656565;
  --action: #111111;
  --action-hover: #303030;
  --action-active: #454545;
  --action-text: #ffffff;
  --focus: #2563eb;
  --shadow: 0 2px 8px rgba(23, 23, 23, 0.12);

  color-scheme: light dark;
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e0e10;
    --surface: #17171a;
    --surface-sunken: #121215;
    --line: #2b2b30;
    --line-soft: #232327;
    --text: #f2f2f0;
    --text-muted: #c2c2be;
    --text-quiet: #97978f;
    --action: #f2f2f0;
    --action-hover: #ffffff;
    --action-active: #d8d8d4;
    --action-text: #111111;
    --focus: #7aa7ff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  }
}

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

html,
body {
  min-width: 320px;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  padding: 24px;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  color: var(--text);
  background: var(--page);
}

a,
button {
  font: inherit;
  letter-spacing: inherit;
}

h1,
h2,
p,
figure {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Layout ------------------------------------------------------------------ */

.landing {
  width: min(100%, 680px);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "statement"
    "purchase";
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.statement {
  grid-area: statement;
  min-width: 0;
  padding: clamp(36px, 4.4vw, 68px) clamp(28px, 3.6vw, 60px) 0;
}

.statement > * {
  width: 100%;
  max-width: 32rem;
  margin-inline: auto;
}

.purchase {
  grid-area: purchase;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(40px, 5vh, 56px) clamp(28px, 3.6vw, 60px) clamp(36px, 4.4vw, 60px);
}

.purchase > * {
  margin-inline: auto;
}

/* Statement --------------------------------------------------------------- */

h1 {
  font-size: clamp(3.4rem, 5.8vw, 5.6rem);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.description {
  max-width: 32rem;
  margin-top: clamp(24px, 3.4vh, 40px);
  color: var(--text-muted);
  font-size: clamp(1.05rem, 1.4vw, 1.28rem);
  line-height: 1.5;
  text-wrap: pretty;
}

/* Purchase ---------------------------------------------------------------- */

.price {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 28rem;
  margin-bottom: 22px;
}

.price-amount {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 600;
  line-height: 1.12;
}

.price-note {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.cta {
  width: 100%;
  min-height: 64px;
  max-width: 28rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  border-radius: 16px;
  color: var(--action-text);
  background: var(--action);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color 160ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cta:hover {
  background: var(--action-hover);
  transform: translateY(-1px);
}

.cta:active {
  background: var(--action-active);
  transform: translateY(0);
}

.cta:focus-visible,
.quiet-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.fine-print {
  max-width: 30rem;
  margin-top: 14px;
  color: var(--text-quiet);
  font-size: 0.8rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.quiet-link {
  color: var(--text-muted);
  text-decoration-line: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.quiet-link:hover {
  color: var(--text);
}

.download-sha {
  display: flex;
  gap: 0.5rem;
  margin-top: 12px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.download-sha code {
  min-width: 0;
  color: inherit;
  font: inherit;
  overflow-wrap: anywhere;
}

/* Narrow widths ----------------------------------------------------------- */

@media (max-width: 900px) {
  body {
    padding: 20px;
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .landing {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
      "statement"
      "purchase";
  }

  .statement {
    padding: 36px 24px 0;
  }

  .purchase {
    padding: 32px 24px 34px;
  }
}

@media (max-width: 420px) {
  body {
    padding: 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .landing {
    border-radius: 14px;
  }

  h1 {
    font-size: clamp(2.9rem, 14vw, 3.6rem);
  }

  .statement {
    padding: 30px 20px 0;
  }

  .description {
    margin-top: 20px;
    font-size: 1rem;
    line-height: 1.52;
  }

  .purchase {
    padding: 28px 20px 30px;
  }

  .price-amount {
    font-size: 1.5rem;
  }

  .cta {
    min-height: 62px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta {
    transition: none;
  }

  .cta:hover,
  .cta:active {
    transform: none;
  }
}
