:root {
  color-scheme: light;
  --paper: #f1efe9;
  --paper-solid: #faf8f3;
  --paper-wash: rgba(250, 248, 243, .72);
  --ink: #19221e;
  --text: #3e4943;
  --muted: #68716c;
  --jade: #315c4a;
  --jade-deep: #214838;
  --line: rgba(49, 92, 74, .23);
  --line-strong: rgba(25, 34, 30, .28);
  --danger: #8b4a45;
  --display: "Newsreader", Georgia, serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --z-header: 30;
  --z-mobile-nav: 50;
  --z-modal: 90;
  --z-toast: 80;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { color: inherit; font: inherit; }
button { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, .empty-state h3:focus-visible {
  outline: 2px solid var(--jade-deep);
  outline-offset: 3px;
}
button:active { transform: translateY(1px); }

.you-page {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--paper);
  background-image: url('/assets/ink-mirror/product-shell-desktop-v101.jpg');
  background-position: center top;
  background-size: 100% auto;
  background-repeat: repeat-y;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--jade-deep);
  color: var(--paper-solid);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 180ms ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 52px;
  border-bottom: 1px solid rgba(25, 34, 30, .09);
  background: rgba(241, 239, 233, .9);
  backdrop-filter: blur(15px);
}

.wordmark {
  min-width: 66px;
  min-height: 44px;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.055em;
}

.product-nav { display: flex; align-items: center; gap: clamp(36px, 4.2vw, 66px); }
.product-nav--mobile { display: none; }
.nav-item {
  position: relative;
  min-height: 44px;
  appearance: none;
  border: 0;
  padding: 0 2px;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  line-height: 44px;
}
.nav-item::after {
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  height: 2px;
  background: var(--jade);
  content: "";
  opacity: 0;
  transform: scaleX(.65);
  transition: opacity 180ms ease, transform 180ms ease;
}
.nav-item:hover, .nav-item.is-active { color: var(--jade-deep); }
.nav-item.is-active::after { opacity: 1; transform: scaleX(1); }

.page-main {
  width: min(calc(100% - 104px), 1120px);
  margin: 0 auto;
  padding: 84px 0 88px;
}

.page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: end;
  gap: 72px;
  padding: 0 0 58px;
}
.eyebrow, .modal-eyebrow, .profile-label {
  margin: 0;
  color: var(--jade-deep);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .17em;
}
.page-intro h1 {
  max-width: 780px;
  margin: 13px 0 0;
  font-family: var(--display);
  font-size: clamp(64px, 7vw, 92px);
  font-weight: 400;
  line-height: .93;
  letter-spacing: -.055em;
}
.intro-copy {
  max-width: 34ch;
  margin: 0 0 7px;
  color: #46514b;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.34;
  letter-spacing: -.018em;
}

.account-stack {
  border-top: 1px solid var(--line-strong);
}
.account-panel {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
  gap: clamp(48px, 7vw, 96px);
  padding: 42px 0 46px;
  border-bottom: 1px solid var(--line);
}
.panel-heading { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-content: start; }
.panel-heading > span { padding-top: 5px; color: var(--jade-deep); font-size: 10px; font-weight: 600; letter-spacing: .12em; }
.panel-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.035em;
}
.panel-heading p {
  max-width: 31ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.panel-body { min-width: 0; }

.auth-form { display: grid; gap: 10px; }
.auth-form label { color: var(--ink); font-size: 12px; font-weight: 600; }
.auth-form input {
  width: 100%;
  min-height: 54px;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 0 16px;
  background: rgba(250, 248, 243, .76);
  font-size: 16px;
}
.auth-form input::placeholder { color: #7f8782; }
.auth-form input[aria-invalid="true"] { border-color: var(--danger); }
.code-input { font-variant-numeric: tabular-nums; letter-spacing: .24em; }
.field-note, .form-error, .form-message, .quiet-note { margin: 0; font-size: 12.5px; line-height: 1.55; }
.field-note, .quiet-note { color: var(--muted); }
.form-error { color: var(--danger); }
.form-message { color: var(--jade-deep); }

.primary-action, .secondary-action, .google-action, .danger-action {
  min-height: 50px;
  appearance: none;
  border-radius: 0;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.primary-action { border: 1px solid var(--ink); background: var(--ink); color: var(--paper-solid); }
.primary-action:hover { background: var(--jade-deep); border-color: var(--jade-deep); }
.secondary-action { border: 1px solid var(--line-strong); background: rgba(250, 248, 243, .65); }
.secondary-action:hover, .google-action:hover { border-color: var(--jade); color: var(--jade-deep); }
.google-action { width: 100%; border: 1px solid var(--line-strong); background: rgba(250, 248, 243, .5); }
.danger-action { border: 1px solid rgba(139, 74, 69, .42); background: transparent; color: var(--danger); }
.danger-action--filled { background: var(--danger); color: #fff; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 11px; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.inline-actions { display: flex; align-items: center; gap: 22px; margin-top: 3px; }
.inline-actions button {
  min-height: 44px;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--jade-deep);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.access-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 28px 0 0;
}
.access-facts > div { padding-top: 12px; border-top: 1px solid var(--line); }
.access-facts dt { color: var(--jade-deep); font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.access-facts dd { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.account-email {
  margin: 0 0 20px;
  font-family: var(--display);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.identity-panel .secondary-action { min-width: 150px; }
.account-profile-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.account-profile-toolbar > div > p:last-child {
  max-width: 54ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.account-profile-toolbar .primary-action { flex: 0 0 auto; }
.profile-message { min-height: 20px; margin-bottom: 6px; }
.profile-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.profile-row.is-active { padding-left: 14px; border-left: 2px solid var(--jade); }
.profile-row h3, .empty-state h3 {
  margin: 7px 0 4px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.03em;
}
.profile-row p, .empty-state p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.profile-actions {
  max-width: 360px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}
.profile-actions .account-action { min-height: 44px; padding: 10px 13px; }
.current-profile-status { max-width: 25ch; color: var(--jade-deep); font-size: 11px; line-height: 1.45; text-align: right; }
.empty-state { padding: 4px 0; }

.contact-link {
  display: inline-block;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(26px, 2.5vw, 32px);
  line-height: 1.15;
  text-decoration-color: var(--jade);
  text-decoration-thickness: 1px;
  text-underline-offset: 7px;
  overflow-wrap: anywhere;
}
.contact-panel .field-note { margin-top: 14px; }

.legal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 8px;
  color: var(--muted);
  font-size: 11px;
}
.legal-footer > span { font-family: var(--display); font-size: 19px; color: var(--ink); }
.legal-footer > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 22px; }
.legal-footer button {
  min-height: 44px;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.modal-backdrop, .legal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(25, 34, 30, .36);
  backdrop-filter: blur(10px);
}
.modal {
  width: min(100%, 590px);
  border: 1px solid var(--line-strong);
  padding: clamp(28px, 5vw, 48px);
  background: var(--paper-solid);
}
.modal h2, .legal-sheet h2 {
  margin: 12px 0 18px;
  font-family: var(--display);
  font-size: clamp(40px, 5vw, 58px);
  font-weight: 400;
  line-height: .97;
  letter-spacing: -.045em;
}
.modal > p:not(.modal-eyebrow), .legal-sheet > p:not(.modal-eyebrow) { color: var(--text); font-size: 15px; line-height: 1.65; }
.modal ul { margin: 20px 0 0; padding-left: 20px; color: var(--text); font-size: 13px; line-height: 1.7; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 30px; }
.legal-backdrop { place-items: stretch end; padding: 0; }
.legal-sheet {
  width: min(100%, 660px);
  min-height: 100%;
  padding: clamp(34px, 6vw, 72px);
  background: var(--paper-solid) url('/assets/ink-mirror/product-shell-mobile-v101.jpg') center top / cover no-repeat;
}
.sheet-close {
  min-width: 72px;
  min-height: 44px;
  display: block;
  margin: 0 0 80px auto;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: rgba(250, 248, 243, .7);
  cursor: pointer;
  font-size: 12px;
}
.legal-note { padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted) !important; font-size: 12px !important; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--z-toast);
  max-width: min(380px, calc(100% - 48px));
  padding: 14px 17px;
  border: 1px solid rgba(250, 248, 243, .18);
  background: var(--ink);
  color: var(--paper-solid);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 820px) {
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .you-page { background-image: url('/assets/ink-mirror/product-shell-mobile-v101.jpg'); background-size: cover; background-attachment: fixed; }
  .site-header {
    min-height: 57px;
    padding: max(7px, env(safe-area-inset-top)) 22px 5px;
    background: rgba(243, 241, 235, .93);
    backdrop-filter: blur(13px);
    border-bottom: 1px solid rgba(25, 34, 30, .09);
  }
  .site-header > .product-nav { display: none; }
  .wordmark { min-height: 44px; font-size: 23px; }
  .product-nav--mobile {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-mobile-nav);
    height: calc(58px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 0 9px env(safe-area-inset-bottom);
    border: 0;
    border-top: 1px solid rgba(25, 34, 30, .16);
    background: rgba(248, 246, 241, .96);
    backdrop-filter: blur(13px);
  }
  .product-nav--mobile .nav-item { min-width: 0; min-height: 44px; padding: 0 4px; font-size: 12.5px; line-height: 44px; }
  .product-nav--mobile .nav-item.is-active { background: transparent; color: var(--jade-deep); }
  .product-nav--mobile .nav-item::after { right: 14%; bottom: 4px; left: 14%; display: block; }
  .page-main { width: min(calc(100% - 40px), 680px); padding: 34px 0 38px; }
  .page-intro { grid-template-columns: 1fr; gap: 17px; padding-bottom: 32px; }
  .page-intro h1 { max-width: 8ch; font-size: clamp(54px, 14vw, 76px); }
  .intro-copy { max-width: 31ch; font-size: 18px; }
  .account-panel { grid-template-columns: 1fr; gap: 22px; padding: 28px 0 31px; }
  .panel-heading { grid-template-columns: 26px minmax(0, 1fr); gap: 9px; }
  .panel-heading h2 { font-size: 30px; }
  .panel-heading p { max-width: 35ch; }
  .toast { right: 14px; bottom: calc(72px + env(safe-area-inset-bottom)); left: 14px; max-width: none; }
}

@media (max-width: 520px) {
  .page-main { width: calc(100% - 36px); padding-top: 20px; }
  .page-intro { padding-bottom: 27px; }
  .page-intro h1 { font-size: clamp(49px, 13.5vw, 58px); }
  .intro-copy { font-size: 17px; line-height: 1.4; }
  .account-panel { gap: 20px; padding: 25px 0 28px; }
  .panel-heading p { font-size: 14px; line-height: 1.55; }
  .auth-form label { font-size: 13px; }
  .field-note, .form-error, .form-message, .quiet-note { font-size: 13px; }
  .access-facts { grid-template-columns: 1fr; gap: 12px; margin-top: 24px; }
  .account-profile-toolbar { align-items: flex-start; flex-direction: column; }
  .account-profile-toolbar .primary-action { width: 100%; }
  .profile-row { align-items: flex-start; flex-direction: column; gap: 20px; }
  .profile-actions { width: 100%; max-width: none; display: grid; grid-template-columns: 1fr 1fr; }
  .profile-actions .account-action, .identity-panel .secondary-action { width: 100%; }
  .current-profile-status { grid-column: 1 / -1; max-width: none; text-align: left; }
  .contact-link { font-size: clamp(21px, 6vw, 24px); }
  .legal-footer { align-items: flex-start; flex-direction: column; padding-top: 24px; }
  .legal-footer > div { justify-content: flex-start; gap: 0 16px; }
  .legal-footer button { font-size: 10.5px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: calc(100dvh - 28px); overflow-y: auto; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); }
  .modal-actions { grid-template-columns: 1fr; }
  .legal-sheet { padding: 28px 20px calc(112px + env(safe-area-inset-bottom)); }
  .sheet-close { margin-bottom: 58px; }
}

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