:root {
  color-scheme: light dark;
  --background: #f4f1ea;
  --surface: #ffffff;
  --surface-muted: #e8e3d8;
  --text: #1f1f1f;
  --text-secondary: #6e6a61;
  --border: #d8d2c7;
  --accent: #c65a3a;
  --accent-dark: #923e29;
  --ink: #232321;
  --paper-on-ink: #f5f1e8;
  --success: #5f6f52;
  --screen: 20px;
  --max-width: 1180px;
  --cut: 18px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Yu Gothic", YuGothic, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  translate: 0 -160%;
  background: var(--text);
  color: var(--background);
  font-size: 13px;
  text-decoration: none;
}

.skip-link:focus {
  translate: 0;
}

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

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - (var(--screen) * 2)), var(--max-width));
  min-height: 72px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--border);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: .13em;
  line-height: 1;
  text-decoration: none;
}

.wordmark-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding-bottom: 1px;
  background: var(--text);
  clip-path: polygon(0 0, 74% 0, 100% 26%, 100% 100%, 0 100%);
  color: var(--background);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.header-label {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
}

.section-shell {
  width: min(calc(100% - (var(--screen) * 2)), var(--max-width));
  margin-inline: auto;
}

.hero {
  display: grid;
  gap: 48px;
  padding-block: 72px 88px;
}

.hero-copy {
  align-self: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
  line-height: 1.4;
}

.eyebrow > span:first-child {
  color: var(--accent);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(35px, 10.5vw, 70px);
  font-weight: 620;
  letter-spacing: -.055em;
  line-height: 1.17;
}

.hero-lead {
  max-width: 650px;
  margin: 28px 0 0;
  color: var(--text-secondary);
  font-size: clamp(16px, 4.8vw, 20px);
  line-height: 1.85;
}

.quiet-note {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  max-width: 560px;
  margin-top: 40px;
}

.quiet-note-line {
  height: 2px;
  margin-top: 13px;
  background: var(--accent);
}

.quiet-note p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.8;
}

.routine-object {
  align-self: center;
  min-width: 0;
  border: 1px solid var(--text);
  background: var(--surface);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}

.object-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  min-height: 104px;
  padding: 22px;
  border-bottom: 1px solid var(--text);
}

.object-head > div {
  display: grid;
  gap: 4px;
}

.object-head strong {
  font-size: 17px;
  font-weight: 650;
}

.object-kicker {
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}

.object-time {
  padding-top: 1px;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  font-weight: 520;
  letter-spacing: -.04em;
}

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

.object-list li {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  min-height: 66px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
}

.object-list li.is-active {
  background: var(--surface-muted);
}

.object-list li.is-active::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 66px;
  background: var(--accent);
  content: "";
}

.object-index,
.object-duration {
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}

.object-name {
  font-size: 14px;
  font-weight: 620;
}

.object-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 64px;
  background: var(--text);
  color: var(--background);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
}

.principles {
  padding-block: 72px 96px;
  border-top: 1px solid var(--border);
}

.section-heading {
  display: grid;
  gap: 0;
  margin-bottom: 44px;
}

.section-heading h2,
.share-band h2 {
  margin: 0;
  font-size: clamp(27px, 7vw, 46px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.3;
}

.principle-grid {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cut-panel {
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}

.panel-number {
  display: block;
  margin-bottom: 52px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: .12em;
}

.cut-panel h3,
.value-list h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 650;
}

.cut-panel p,
.value-list p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.85;
}

.share-section {
  padding-block: 0 96px;
}

.share-band {
  display: grid;
  gap: 40px;
  padding: 32px 24px 40px;
  background: var(--ink);
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 0 100%);
  color: var(--paper-on-ink);
}

.eyebrow-on-dark {
  color: #b9b5ad;
}

.share-copy {
  align-self: end;
}

.share-copy p {
  margin: 0;
  color: #d3cfc7;
  font-size: 14px;
  line-height: 1.9;
}

.share-copy .share-caption {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #54514b;
  color: #a9a59d;
  font-size: 12px;
}

.values {
  padding-block: 0 104px;
}

.compact-heading {
  margin-bottom: 36px;
}

.value-list {
  display: grid;
  gap: 32px;
}

.value-list article {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 16px;
}

.value-list article > :not(.value-rule) {
  grid-column: 2;
}

.value-rule {
  grid-row: 1 / span 2;
  width: 2px;
  height: 100%;
  min-height: 72px;
  background: var(--accent);
}

.site-footer {
  display: grid;
  gap: 20px;
  width: min(calc(100% - (var(--screen) * 2)), var(--max-width));
  margin-inline: auto;
  padding-block: 40px calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.site-footer .copyright {
  font-size: 10px;
  letter-spacing: .08em;
}

/* Shared-link fallback */

.share-page {
  min-height: 100svh;
}

.share-header {
  width: min(calc(100% - (var(--screen) * 2)), 760px);
}

.share-main {
  display: grid;
  justify-items: center;
  width: min(calc(100% - (var(--screen) * 2)), 620px);
  margin-inline: auto;
  padding-block: 48px 40px;
}

.open-card {
  width: 100%;
  border: 1px solid var(--text);
  background: var(--surface);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}

.open-card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--text);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .16em;
}

.open-card-body {
  padding: 32px 24px 28px;
}

.open-symbol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: 54px;
  height: 38px;
  margin-bottom: 40px;
}

.open-symbol span {
  background: var(--text);
}

.open-symbol span:nth-child(2) {
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 78%, 78% 100%, 0 100%);
}

.open-card h1 {
  font-size: clamp(32px, 9vw, 52px);
}

.open-description {
  margin: 24px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.9;
}

.app-open-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  margin-top: 32px;
  padding: 0 20px;
  background: var(--text);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  color: var(--background);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
}

.app-open-button:active {
  background: var(--accent-dark);
}

.app-open-button.is-disabled {
  background: var(--surface-muted);
  color: var(--text-secondary);
  cursor: not-allowed;
  pointer-events: none;
}

.button-arrow {
  font-size: 18px;
  font-weight: 500;
}

.open-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
}

.safety-note {
  margin-top: 28px;
  padding: 18px;
  border-left: 3px solid var(--success);
  background: var(--surface-muted);
}

.safety-note strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}

.safety-note p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.8;
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.share-footer {
  width: min(calc(100% - (var(--screen) * 2)), 620px);
  margin: 0 auto;
  padding: 0 0 calc(32px + env(safe-area-inset-bottom));
  color: var(--text-secondary);
  font-size: 10px;
  text-align: center;
}

.share-footer p {
  margin: 0;
}

.error-main {
  min-height: calc(100svh - 92px);
  align-content: center;
  padding-bottom: 88px;
}

.secondary-open-button {
  background: var(--surface-muted);
  color: var(--text);
}

@media (min-width: 700px) {
  :root {
    --screen: 32px;
    --cut: 22px;
  }

  .site-header {
    min-height: 88px;
  }

  .hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 64px;
    min-height: min(760px, calc(100svh - 88px));
    padding-block: 88px 104px;
  }

  .principle-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .share-band {
    grid-template-columns: 1.25fr .75fr;
    gap: 64px;
    padding: 48px;
  }

  .value-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 64px;
  }

  .site-footer {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .share-main {
    padding-block: 72px 48px;
  }

  .open-card-body {
    padding: 48px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #151515;
    --surface: #202020;
    --surface-muted: #2a2a2a;
    --text: #f1eee8;
    --text-secondary: #aaa49a;
    --border: #3a3936;
    --accent: #d06b4b;
    --accent-dark: #b75438;
    --ink: #e9e5dc;
    --paper-on-ink: #1d1d1c;
    --success: #7c8a6b;
  }

  .share-band .eyebrow-on-dark,
  .share-band .share-copy p {
    color: #4f4d48;
  }

  .share-band .share-copy .share-caption {
    border-color: #c6c0b6;
    color: #69665f;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
