:root {
  color-scheme: light;
  --paper: #f8f4ed;
  --surface: #fffcf6;
  --ink: #202b36;
  --muted: #4b545d;
  --accent: #8a3d2c;
  --accent-deep: #743122;
  --field: #eae2d6;
  --line: #bfb4a5;
  --control-line: #736b61;
  --plate: #283540;
  --plate-ink: #fff8ea;
  --plate-muted: #e3d7c8;
  --plate-rule: #857b70;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(1rem, 5.13vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--sans); }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.04; }
button, select { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[id] { scroll-margin-top: 1.25rem; }

.shell { width: min(calc(100% - var(--gutter) * 2), 77rem); margin-inline: auto; }
.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 2;
  padding: .65rem 1rem;
  transform: translateY(-200%);
  background: var(--surface);
}
.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex;
  min-height: 3.7rem;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
}
.wordmark {
  display: inline-flex;
  min-height: 2.75rem;
  width: fit-content;
  align-items: center;
  gap: .42rem;
  color: var(--ink);
  font-size: clamp(.75rem, 3.35vw, 1.02rem);
  font-weight: 750;
  letter-spacing: -.045em;
  line-height: 1.1;
  text-decoration: none;
}
.mirror-mark {
  display: inline-grid;
  width: 1.35rem;
  height: 1.48rem;
  flex: 0 0 1.35rem;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50% 50% 42% 42%;
}
.mirror-mark::after {
  width: .43rem;
  height: .62rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  content: '';
}
nav { display: flex; flex: 0 0 auto; align-items: center; gap: clamp(.5rem, 3vw, 1.75rem); }
nav a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  color: var(--muted);
  font-size: clamp(.68rem, 2.85vw, .88rem);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
nav a:hover, .text-link:hover, .site-footer p a:hover { color: var(--accent); text-decoration: underline; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "figure" "copy";
  align-items: start;
  gap: 1.22rem;
  padding-block: .8rem 1.9rem;
}
.hero-copy { grid-area: copy; }
h1 {
  font: 400 clamp(2.65rem, 12.25vw, 4.6rem)/.97 var(--serif);
  letter-spacing: -.07em;
}
h1 em {
  display: block;
  margin-top: .08em;
  color: var(--accent);
  font-size: 1.06em;
  letter-spacing: -.07em;
}
.hero-intro { max-width: 37ch; margin-top: .72rem; color: var(--muted); font-size: .94rem; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem .75rem;
  margin-top: .82rem;
}
.button {
  display: inline-flex;
  max-width: 100%;
  min-height: 3rem;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border: 1px solid var(--accent-deep);
  border-radius: .14rem;
  padding: .65rem .8rem;
  background: var(--accent-deep);
  color: var(--surface);
  font-size: .8rem;
  font-weight: 700;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.button:hover { border-color: var(--accent); background: var(--accent); }
.button span { font-size: 1rem; line-height: 1; }
.text-link, .check-result a { color: var(--accent-deep); font-weight: 650; text-underline-offset: .25em; }
.text-link { display: inline-flex; min-height: 2.75rem; align-items: center; font-size: .76rem; }
.hero-note { margin-top: .34rem; color: var(--muted); font-size: .77rem; }

.hero-figure {
  min-width: 0;
  grid-area: figure;
  border: 1px solid var(--plate);
  background: var(--plate);
  color: var(--plate-ink);
}
.portrait {
  --portrait-height: clamp(10.55rem, 51vw, 14.25rem);
  --portrait-width: min(100%, calc(var(--portrait-height) * 1.3333));
  position: relative;
  isolation: isolate;
  height: var(--portrait-height);
  overflow: hidden;
}
.portrait img {
  width: var(--portrait-width);
  height: 100%;
  margin-inline: auto;
  object-fit: contain;
}
.portrait::before,
.portrait::after {
  position: absolute;
  content: '';
  pointer-events: none;
}
.portrait::before {
  inset: .6rem;
  border: 1px solid #fff4db75;
}
.portrait::after {
  inset: 0 calc((100% - var(--portrait-width)) / 2);
  border-inline: 1px solid #fff4db7a;
}
.measure-width, .measure-length {
  position: absolute;
  z-index: 1;
  color: #fff6db;
  filter: drop-shadow(0 1px 1px #492819);
  pointer-events: none;
}
.measure-width {
  inset: 48.5% auto auto calc(50% - var(--portrait-width) * .17);
  width: calc(var(--portrait-width) * .35);
  border-block-start: 1px dashed currentColor;
}
.measure-length {
  inset: 17% auto 28% calc(50% + var(--portrait-width) * .25);
  border-inline-start: 1px dashed currentColor;
}
.measure-width::before, .measure-width::after, .measure-length::before, .measure-length::after {
  position: absolute;
  background: currentColor;
  content: '';
}
.measure-width::before, .measure-width::after { top: -.31rem; width: 1px; height: .58rem; }
.measure-width::before { left: 0; }
.measure-width::after { right: 0; }
.measure-length::before, .measure-length::after { left: -.31rem; width: .58rem; height: 1px; }
.measure-length::before { top: 0; }
.measure-length::after { bottom: 0; }
.hero-figure figcaption {
  border-top: 1px solid var(--plate-rule);
  padding: .58rem .7rem .62rem;
  color: var(--plate-muted);
  font-size: .74rem;
  line-height: 1.4;
}

.check-section { border-block: 1px solid var(--line); padding-block: 2.6rem 2.8rem; background: var(--field); }
.check-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 1.85rem; }
h2 { font-size: clamp(2.08rem, 8vw, 3.85rem); font-weight: 650; letter-spacing: -.065em; }
.check-guide > p, .section-intro p { max-width: 53ch; margin-top: .85rem; color: var(--muted); }
.feature-list { margin: 1.1rem 0 0; padding: 0; list-style: none; }
.feature-list li {
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr);
  gap: .65rem;
  border-top: 1px solid var(--line);
  padding-block: .65rem;
  font-size: .9rem;
}
.feature-list li:last-child { border-bottom: 1px solid var(--line); }
.feature-list strong, .shape-card strong { color: var(--accent-deep); }
.feature-list span { color: var(--muted); }
.check-guide > .check-note { font-size: .84rem; }
.check-panel { min-width: 0; border-top: 2px solid var(--accent); padding-top: 1.05rem; }
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; font: 1.95rem/1.05 var(--serif); letter-spacing: -.055em; }
label { display: block; margin: 1rem 0 .35rem; font-size: .85rem; font-weight: 720; }
select {
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  border: 1px solid var(--control-line);
  border-radius: 0;
  padding: .55rem .7rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  text-overflow: ellipsis;
}
select:hover { border-color: var(--accent-deep); }
.check-panel .button { width: 100%; margin-top: 1rem; padding-inline: .85rem; font-size: .88rem; }
.check-result { margin-top: 1.35rem; border-block: 1px solid var(--line); padding: .95rem 0 1rem; }
.check-result h3 { font: 1.6rem/1.05 var(--serif); letter-spacing: -.03em; }
.check-result p { margin-top: .48rem; color: var(--muted); }
.check-result ul { margin: .55rem 0 0; padding-inline-start: 1.15rem; }
.check-result a { display: inline-flex; min-height: 2.75rem; align-items: center; }

.shape-section { padding-block: 2.65rem 3rem; }
.section-intro { margin-bottom: 1.35rem; }
.shape-grid { display: grid; grid-template-columns: minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.shape-card {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(5.2rem, 34%) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  gap: .42rem clamp(.65rem, 3vw, 1.25rem);
  border-top: 1px solid var(--line);
  padding-block: 1.15rem;
}
.shape-card:target, .triangle-note:target { outline: 2px solid var(--accent); outline-offset: .22rem; }
.shape-card h3, .shape-card p { grid-column: 2; }
.shape-card h3, .triangle-note h3 { font: 1.8rem/1.04 var(--serif); letter-spacing: -.045em; }
.shape-card p, .triangle-note p { color: var(--muted); font-size: .92rem; overflow-wrap: break-word; }
.outline {
  display: block;
  align-self: start;
  grid-area: 1 / 1 / span 3;
  width: 100%;
  aspect-ratio: 1;
  background-color: var(--field);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: grayscale(1) sepia(.29) saturate(1.28) hue-rotate(-24deg);
}
.outline.oval { background-image: url('./face-oval.webp?v=mannequin'); }
.outline.round { background-image: url('./face-round.webp?v=mannequin'); }
.outline.square { background-image: url('./face-square.webp?v=mannequin'); }
.outline.heart { background-image: url('./face-heart.webp?v=mannequin'); }
.outline.diamond { background-image: url('./face-diamond.webp?v=mannequin'); }
.outline.oblong { background-image: url('./face-oblong.webp?v=mannequin'); }
.triangle-note { margin-top: 1.4rem; border-inline-start: 2px solid var(--accent); padding: .1rem 0 .15rem .85rem; }
.triangle-note h3 { font-size: 1.55rem; }
.triangle-note p { max-width: 64ch; margin-top: .45rem; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem 1.25rem; padding-block: .85rem 1.1rem; }
.site-footer p { color: var(--muted); font-size: .77rem; }
.site-footer p a { text-underline-offset: .2em; }

@media (max-width: 22rem) {
  .header-inner { gap: .45rem; }
  .wordmark { gap: .3rem; }
  .hero-actions { column-gap: .58rem; }
  .hero-actions .button { gap: .5rem; padding-inline: .62rem; }
  .text-link { font-size: .74rem; }
  .hero { gap: 1.05rem; }
}

@media (min-width: 45rem) {
  .header-inner { min-height: 4.1rem; }
  .hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-areas: "figure copy";
    align-items: center;
    gap: clamp(2.2rem, 5.8vw, 6.4rem);
    padding-block: clamp(2.1rem, 4.7vw, 4.9rem);
  }
  h1 { font-size: clamp(3.4rem, 7.1vw, 7rem); }
  .hero-intro { margin-top: 1.25rem; font-size: clamp(1rem, 1.5vw, 1.18rem); }
  .hero-actions { gap: .5rem 1.1rem; margin-top: 1.45rem; }
  .button { min-height: 3.15rem; padding-inline: .95rem; font-size: .88rem; }
  .text-link { font-size: .85rem; }
  .hero-note { margin-top: .8rem; font-size: .8rem; }
  .portrait { --portrait-height: clamp(15rem, 33vw, 29rem); }
  .portrait img { object-fit: cover; }
  .portrait::before { inset: .78rem; }
  .hero-figure figcaption { font-size: .81rem; }
  .check-section, .shape-section { padding-block: clamp(3.6rem, 7vw, 6.5rem); }
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 8vw, 8rem); }
  .check-panel { padding-top: 1.2rem; }
  .check-panel .button { width: auto; min-width: 13rem; }
  .section-intro { margin-bottom: 2rem; }
  .shape-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(1.5rem, 5vw, 5rem); }
  .shape-card { grid-template-columns: minmax(6.3rem, 32%) minmax(0, 1fr); padding-block: 1.45rem; }
  .footer-inner { padding-block: 1.18rem; }
}

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