@font-face {
  font-family: "Noto Sans SC";
  src: url("assets/noto-sans-sc-ui.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #faf2e9;
  --surface: #fcf7f0;
  --edge: #ddcfc3;
  --quiet-paper: #f3e9df;
  --ink: var(--ot-brand-ink);
  --muted: #536278;
  --charcoal: #181818;
  --on-dark: #e1e7f1;
  --coral: var(--ot-brand-coral);
  --selected: #9d2c1c;
  --blue: var(--ot-brand-tool);
  --glass: var(--ot-brand-glass);
  --gold: var(--ot-brand-gold);
  --white: var(--ot-brand-white);
  --max-width: 1272px;
  --page-gutter: clamp(24px, 5.84vw, 84px);
  --cut: 12px;
  --control: 52px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; }
button { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.masthead :focus-visible, .skip-link:focus-visible { outline-color: var(--glass); }

.wrap { width: min(var(--max-width), 100% - 2 * var(--page-gutter)); margin-inline: auto; }
.skip-link.button { position: absolute; inset: 8px auto auto 12px; z-index: 3; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.button {
  --button-fill: var(--surface);
  --button-hover: #f5e9da;
  --button-text: var(--ink);
  --button-edge: var(--edge);
  --button-cut: 10px;
  --button-depth: #adb8c9;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  min-height: var(--control);
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 22px;
  border: 0;
  background: transparent;
  color: var(--button-text);
  font-size: 1.125rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border-radius: 5px;
}
.button::before, .button::after, .sheet::before, .sheet::after {
  --c: var(--button-cut, var(--cut));
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
  pointer-events: none;
}
.button::before { background: var(--button-edge); filter: none; }
.button::after { inset: 1px; --c: calc(var(--button-cut) - 1px); background: var(--button-fill); }
.button--paper, .button--ink { filter: drop-shadow(0 3px 0 var(--button-depth)); }
.button--ink { --button-fill: var(--ink); --button-hover: #294476; --button-text: var(--white); --button-edge: var(--ink); --button-depth: #101e36; }
.button--outline { --button-edge: #aebacc; }
.button--compact { --control: 44px; --button-cut: 8px; font-size: .9375rem; padding-inline: 18px; }
.button:hover:not(:disabled) { --button-fill: var(--button-hover); }
.button:active:not(:disabled) { transform: translateY(2px); filter: none; }
.button:disabled { --button-fill: #e8ebf0; --button-edge: #cbd2dd; --button-text: var(--muted); filter: none; cursor: default; }

.text-link, .nav-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  background: none;
  border: 0;
  padding: 0;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: .35em;
}
.text-link { text-decoration-line: underline; cursor: pointer; }
.text-link:hover, .nav-link:hover { color: var(--selected); }
.nav-link { text-decoration: none; }
.nav-link:hover, .nav-link[aria-current="location"] { text-decoration: underline; text-decoration-color: var(--coral); }
.masthead .text-link:hover, .masthead .nav-link:hover { color: var(--glass); }

.masthead {
  isolation: isolate;
  position: relative;
  color: var(--white);
  background: var(--charcoal) url("assets/charcoal-fold.webp") center / 100% 100% no-repeat;
}
.top-nav, .footer {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.top-nav { border-bottom: 1px solid #595959; }
.brand { flex: 0 0 auto; display: flex; min-height: 44px; align-items: center; }
.brand img { height: auto; }
.nav-links, .footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(20px, 3.2vw, 47px); }
.button--nav { --control: 46px; width: 193px; font-size: 1rem; }
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: clamp(24px, 4.9vw, 72px);
  padding-block: 36px 104px;
  min-height: clamp(500px, 51vw, 733px);
}
.hero-copy { padding-block: 18px; align-self: center; transform: translateY(-21px); }
.hero h1 {
  max-width: 100%;
  font-size: clamp(2.4rem, 5.28vw, 4.75rem);
  font-weight: 860;
  line-height: 1.24;
  letter-spacing: -.025em;
}
.hero h1 span { display: block; overflow-wrap: anywhere; }
.hero h1 span + span { font-size: .88em; margin-top: 14px; }
.hero-note { margin-top: clamp(25px, 3.7vw, 54px); border-left: 2px solid var(--gold); padding: 6px 0 6px 14px; color: var(--on-dark); font-size: clamp(.94rem, 1.32vw, 1.1875rem); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin-top: clamp(26px, 4.25vw, 61px); }
.hero-actions .button { min-width: min(100%, 258px); }
.mascot { width: 100%; height: auto; max-width: 595px; justify-self: end; filter: drop-shadow(0 8px 10px #0009); }
.hero-fold { position: absolute; bottom: -1px; left: 0; width: 100%; height: clamp(40px, 4.45vw, 64px); z-index: -1; pointer-events: none; }

section[id] { scroll-margin-top: 16px; }
.demo-section { margin-top: clamp(52px, 5vw, 74px); }
.section-title {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: clamp(2rem, 2.92vw, 2.625rem);
  font-weight: 850;
  line-height: 1.25;
}
.section-title::after { content: ""; height: 1px; background: #a6abba; flex: 1; }
.section-intro { margin-top: 17px; color: var(--muted); font-size: clamp(.94rem, 1.32vw, 1.1875rem); }

.sheet {
  position: relative;
  isolation: isolate;
  --sheet-fill: var(--surface);
}
.sheet::before, .sheet::after { z-index: -2; }
.sheet::before { background: var(--edge); }
.sheet::after { inset: 1px; background: var(--sheet-fill); --c: calc(var(--cut) - 1px); }
.sheet--raised { filter: drop-shadow(0 7px 8px rgb(30 50 92 / 12%)); }
.motif {
  position: absolute;
  pointer-events: none;
  z-index: -1;
  opacity: .24;
  background: url("assets/fold-pattern.svg") right center / 148px repeat;
  mask-image: linear-gradient(90deg, transparent, #000 52%, #000 88%, transparent), linear-gradient(transparent, #000 25%, #000 76%, transparent);
  mask-composite: intersect;
}
.demo { --cut: 16px; margin-top: 30px; padding: 28px 32px 25px; }
.motif--demo { inset: 9px 20px auto auto; width: min(36%, 350px); height: 100px; }
.tabs { display: flex; align-items: flex-end; gap: 9px; border-bottom: 1px solid var(--edge); }
.tab {
  --tab-fill: var(--quiet-paper);
  position: relative;
  isolation: isolate;
  min-width: min(124px, 44%);
  min-height: 47px;
  padding: 8px 16px;
  border: 0;
  border-bottom: 4px solid transparent;
  background: transparent;
  font-size: 1.125rem;
  font-weight: 650;
  cursor: pointer;
}
.tab::before, .tab::after { position: absolute; inset: 0; content: ""; z-index: -1; background: var(--edge); clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%, 0 10px); }
.tab::after { inset: 1px 1px 0; background: var(--tab-fill); }
.tab[aria-selected="true"] { --tab-fill: var(--surface); font-weight: 800; color: var(--selected); border-bottom-color: var(--coral); }
.tab:hover { --tab-fill: #fff8f1; }

.demo-panel { padding-top: 38px; }
.comparison { display: grid; grid-template-columns: minmax(0, 1fr) minmax(38px, 17%) minmax(0, 1fr); align-items: center; }
.comparison-arrow { justify-self: center; width: min(70%, 78px); height: auto; }
.sample { --sheet-fill: var(--white); --cut: 11px; align-self: stretch; min-width: 0; min-height: 248px; padding: 14px 18px 17px; }
.sample--result .sample-label { color: var(--selected); }
.sample--result .sample-text { text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 3px; text-underline-offset: 7px; }
.sample--result .sample-text.is-empty { font-size: 1rem; font-weight: 650; color: var(--muted); text-decoration: none; }
.sample--result { background: no-repeat right top / 32px 32px url("assets/result-corner.webp"); }
.sample--result::after { background: var(--sheet-fill) no-repeat right top / 28px 28px url("assets/result-corner.webp"); }
.sample-bar { display: flex; gap: 5px; align-items: center; height: 25px; padding-bottom: 11px; border-bottom: 1px solid #e3e8ef; }
.sample-bar span { width: 5px; height: 5px; border-radius: 50%; background: #aab7c9; }
.sample-label { color: var(--muted); font-size: .8125rem; font-weight: 750; margin-top: 12px; }
.sample-content { margin-top: 14px; }
.sample-text { font-size: clamp(1.35rem, 2.36vw, 2.125rem); font-weight: 850; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-wrap; }
.sample-detail { display: flex; align-items: end; gap: 10px; justify-content: space-between; margin-top: 22px; }
.sample-detail img { width: 63px; height: auto; }
.sample-lines { width: 48%; align-self: start; display: grid; gap: 8px; }
.sample-lines span { height: 4px; background: #a9b5c7; }
.sample-lines span:nth-child(2) { width: 79%; background: #c5cedb; }
.sample-lines span:nth-child(3) { width: 90%; background: #d6dfea; }
.sample-image { display: block; width: 100%; height: clamp(122px, 12vw, 170px); object-fit: contain; background: #f3f5f8; }

.demo-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; margin-top: 28px; align-items: start; }
.demo-fields { display: grid; gap: 16px; min-width: 0; }
.field { display: grid; min-width: 0; gap: 6px; }
.field label { font-size: .875rem; font-weight: 750; }
.field input, .field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #b7a89e;
  border-radius: 6px;
  padding: 7px 11px;
  color: var(--ink);
  background: var(--white);
  accent-color: var(--ink);
}
.field input[type="file"] { padding: 6px 8px; }
.field input::file-selector-button { color: var(--ink); background: var(--quiet-paper); border: 1px solid var(--edge); border-radius: 4px; padding: 4px 8px; margin-inline-end: 8px; }
.field small { color: var(--muted); font-size: .8125rem; }
.field [aria-invalid="true"] { border: 2px solid var(--selected); }
.demo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 28px; }
.reset-link { font-size: .875rem; }
.demo-feedback { grid-column: 1 / -1; font-size: .875rem; color: var(--muted); padding: 5px 0 5px 10px; border-left: 3px solid var(--edge); min-height: 32px; }
.demo-feedback[data-tone="preview"], .demo-feedback[data-tone="success"] { border-color: var(--blue); }
.demo-feedback[data-tone="error"] { border-color: var(--coral); color: var(--selected); }

.guide-section { position: relative; isolation: isolate; margin-top: clamp(65px, 6.5vw, 95px); }
.motif--guide { width: min(27%, 211px); height: 84px; inset: 35px 16px auto auto; background-size: 115px; }
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 34px 0 0;
  padding: 0;
  list-style-type: none;
}
.step { min-height: 195px; padding: 26px; }
.step h3 { margin-top: 16px; font-size: 1.4375rem; font-weight: 850; line-height: 1.35; }
.step p { margin-top: 12px; color: var(--muted); }

.install-section { margin-top: 52px; }
.install { --cut: 14px; }
.install-summary {
  min-height: 139px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  cursor: pointer;
  list-style: none;
}
.install-summary::-webkit-details-marker { display: none; }
.install-copy { display: grid; gap: 8px; }
.install-copy strong { font-size: clamp(1.375rem, 2vw, 1.75rem); font-weight: 820; }
.install-copy > span { color: var(--muted); }
.install-toggle { min-width: 218px; }
.install-summary:hover .install-toggle { --button-fill: var(--button-hover); }
.install-open, .install[open] .install-closed { display: none; }
.install[open] .install-open { display: inline; }
.install-chevron { filter: brightness(0) invert(1); }
.install[open] .install-chevron { transform: rotate(180deg); }
.install-content { padding: 26px 28px 30px; margin-inline: 1px; border-top: 1px solid var(--edge); overflow-wrap: anywhere; }
.install-content h2 { font-size: clamp(1.25rem, 2.2vw, 1.75rem); font-weight: 830; }
.install-content p { margin-top: 10px; color: var(--muted); }
.install-content ol { padding-inline-start: 1.4rem; }
.install-content li + li { margin-top: 10px; }
.install-content code { background: var(--quiet-paper); border-radius: 3px; padding: 2px 4px; font-size: .9em; }
.footer { min-height: 83px; margin-top: 63px; border-top: 1px solid #a6abba; }
.footer nav { gap: 8px clamp(12px, 3vw, 43px); font-size: .9375rem; }

@media (max-width: 1099px) {
  .hero { gap: 28px; min-height: 0; padding-block: 62px 84px; }
  .hero h1 { font-size: clamp(2rem, 5.15vw, 3.55rem); }
  .hero-actions { gap: 12px 18px; }
  .hero-actions .button { min-width: min(100%, 185px); }
  .demo { padding-inline: 25px; }
  .comparison { grid-template-columns: minmax(0, 1fr) 12% minmax(0, 1fr); }
  .step { padding: 20px; }
  .step h3 { font-size: 1.22rem; }
}

@media (max-width: 780px) {
  .demo-form { grid-template-columns: minmax(0, 1fr); }
  .demo-actions { margin-top: 3px; }
}

@media (max-width: 639px) {
  :root { --page-gutter: clamp(16px, 5.8vw, 25px); }
  .masthead { background-image: url("assets/charcoal-fold-mobile.webp"); }
  .top-nav { min-height: 74px; gap: 12px; }
  .top-nav .brand img { width: 64px; }
  .top-nav .nav-link { display: none; }
  .button--nav { width: auto; min-width: 128px; --control: 44px; font-size: .9375rem; padding-inline: 14px; }
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 26px; padding-block: 37px 66px; }
  .hero-copy { padding: 0; align-self: stretch; transform: none; }
  .hero h1 { font-size: clamp(1.85rem, 9.7vw, 2.625rem); }
  .hero h1 span + span { font-size: .86em; margin-top: 8px; }
  .hero-note { margin-top: 20px; padding-inline-start: 10px; }
  .hero-actions { margin-top: 23px; gap: 10px 20px; }
  .hero-actions .button { --control: 48px; min-width: min(100%, 170px); font-size: 1rem; padding-inline: 16px; }
  .hero-actions .text-link { font-size: .9375rem; }
  .mascot { width: min(100%, 374px); align-self: center; }
  .hero-fold { content: url("assets/paper-edge-mobile.webp"); height: clamp(44px, 13.4vw, 58px); }
  .demo-section { margin-top: 39px; }
  .section-title { gap: 18px; }
  .section-intro { margin-top: 12px; }
  .demo { --cut: 14px; margin-top: 28px; padding: 18px 17px 21px; }
  .motif--demo { inset: 8px 10px auto auto; width: min(43%, 147px); height: 76px; background-size: 84px; }
  .tab { min-width: min(97px, 44%); }
  .demo-panel { padding-top: 23px; }
  .comparison { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .comparison-arrow { width: 46px; height: 39px; object-fit: contain; transform: rotate(90deg); }
  .sample { min-height: 176px; padding-inline: 14px; }
  .sample-text { font-size: clamp(1.35rem, 6.5vw, 1.75rem); }
  .sample-detail { margin-top: 18px; }
  .sample-detail img { width: 46px; }
  .sample-image { height: 130px; }
  .demo-form { margin-top: 23px; }
  .demo-actions { gap: 7px 12px; }
  .button--compact { padding-inline: 12px; }
  .motif--guide { inset: 78px 8px auto auto; height: 27px; width: min(35%, 130px); background-size: 75px; }
  .steps { grid-template-columns: 1fr; gap: 16px; margin-top: 28px; }
  .step { min-height: 128px; display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 20px; padding: 21px; }
  .step h3 { margin-top: 0; }
  .step p { margin-top: 7px; font-size: .9375rem; }
  .install-section { margin-top: 47px; }
  .install-summary { display: grid; min-height: 0; padding: 22px; }
  .install-toggle { justify-self: start; min-width: min(100%, 178px); }
  .install-content { padding-inline: 22px; }
  .footer { margin-top: 49px; padding-block: 12px; flex-wrap: wrap; gap: 4px 20px; }
  .footer .brand img { width: 65px; }
  .footer nav { font-size: .8125rem; }
}
