:root {
  --teal: #16b8b4;
  --teal-deep: #079f9e;
  --aqua: #55c6e2;
  --coral: #ff7138;
  --pink: #ff2d68;
  --navy: #10282b;
  --ink: #263234;
  --muted: #687879;
  --page: #f8faf9;
  --white: #ffffff;
  --soft: #edf5f3;
  --line: #d8e4e2;
  --radius: 26px;
  --shadow: 0 24px 70px rgba(16, 78, 78, .15);
}

* { box-sizing: border-box; }
html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
  font-family: "Trebuchet MS", "Avenir Next", Avenir, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.site-header {
  height: 92px;
  width: 100%;
  padding: 0 max(28px, calc((100% - 1320px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 20;
  background: var(--white);
  box-shadow: 0 1px 0 rgba(25, 70, 69, .07);
}

.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { width: 158px; height: auto; display: block; }

.local-pill {
  min-height: 40px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 999px;
  color: var(--white);
  background: linear-gradient(115deg, var(--coral), var(--pink));
  box-shadow: 0 10px 25px rgba(255, 74, 89, .2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.local-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(255,255,255,.18);
}

main { min-height: calc(100vh - 180px); }

.hero {
  min-height: 690px;
  width: 100%;
  margin-bottom: 72px;
  padding: 62px 24px 105px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(118deg, var(--aqua) 0%, var(--teal) 58%, var(--teal-deep) 100%);
}

.hero::before {
  content: "";
  width: 480px;
  height: 480px;
  position: absolute;
  left: -170px;
  top: -210px;
  border: 70px solid rgba(255,255,255,.07);
  border-radius: 50%;
}

.hero::after {
  content: "";
  width: 100%;
  height: 105px;
  position: absolute;
  left: 0;
  bottom: -72px;
  z-index: 0;
  background: linear-gradient(118deg, var(--aqua) 0%, var(--teal) 58%, var(--teal-deep) 100%);
  clip-path: ellipse(64% 100% at 50% 0%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-drop {
  width: 52px;
  height: 66px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  position: relative;
}

.hero-drop svg { width: 48px; height: 64px; fill: var(--white); filter: drop-shadow(0 8px 18px rgba(0,100,105,.16)); }
.hero-drop b { position: absolute; top: 29px; color: var(--teal); font-size: 12px; letter-spacing: -.08em; }

.eyebrow {
  margin: 0 0 12px;
  color: currentColor;
  opacity: .75;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(52px, 6vw, 80px);
  line-height: .92;
  letter-spacing: -.055em;
  text-transform: lowercase;
}

.hero h1 em { font-style: normal; color: var(--white); }

.intro {
  max-width: 650px;
  margin: 22px auto 0;
  color: rgba(255,255,255,.88);
  font-size: 15px;
  line-height: 1.6;
}

.drop-shell {
  width: min(660px, 100%);
  margin-top: 38px;
  position: relative;
  z-index: 3;
}

.drop-zone {
  width: 100%;
  min-height: 286px;
  padding: 38px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 30px;
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}

.drop-zone::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px dashed rgba(22,184,180,.35);
  border-radius: 21px;
  transition: border-color .25s ease, background .25s ease;
}

.drop-zone::after {
  content: "";
  width: 140px;
  height: 140px;
  position: absolute;
  right: -75px;
  top: -75px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--pink));
  opacity: .9;
}

.drop-zone:hover, .drop-zone.dragging {
  transform: translateY(-5px);
  box-shadow: 0 32px 85px rgba(5, 89, 91, .25);
}
.drop-zone:hover::before, .drop-zone.dragging::before { border-color: var(--teal); background: rgba(22,184,180,.035); }

.drop-icon {
  width: 68px;
  height: 68px;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  border-radius: 22px;
  color: var(--white);
  background: linear-gradient(135deg, var(--aqua), var(--teal));
  box-shadow: 0 13px 28px rgba(22,184,180,.3);
  transform: rotate(-3deg);
}

.drop-icon svg { width: 40px; fill: none; stroke: currentColor; stroke-width: 2; }
.drop-title { position: relative; z-index: 1; font-size: 24px; font-weight: 900; letter-spacing: -.04em; }
.drop-subtitle { margin-top: 7px; position: relative; z-index: 1; color: var(--muted); font-size: 13px; }
.drop-limit { margin-top: 24px; position: relative; z-index: 1; color: var(--teal-deep); font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }

.privacy-note {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,.88);
  font-size: 10px;
}
.privacy-note svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.loading-panel, .error-panel {
  min-height: 650px;
  padding: 80px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  color: var(--white);
  background: linear-gradient(118deg, var(--aqua), var(--teal) 60%, var(--teal-deep));
}
.loading-panel h2, .error-panel h2 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 50px); letter-spacing: -.045em; }
.loading-panel > p:last-child { color: rgba(255,255,255,.8); }

.loader-art {
  width: 88px;
  height: 88px;
  margin-bottom: 30px;
  position: relative;
  animation: loader-turn 2.2s cubic-bezier(.7,0,.3,1) infinite;
}
.loader-art span { position: absolute; width: 42px; height: 42px; border-radius: 12px; }
.loader-art span:nth-child(1) { left: 0; top: 0; background: var(--white); }
.loader-art span:nth-child(2) { right: 0; top: 0; background: var(--coral); }
.loader-art span:nth-child(3) { left: 0; bottom: 0; background: var(--pink); }
.loader-art span:nth-child(4) { right: 0; bottom: 0; background: var(--navy); }
@keyframes loader-turn { 0% { transform: rotate(0); } 50% { transform: rotate(90deg) scale(.82); } 100% { transform: rotate(180deg); } }

.error-panel { flex-direction: row; gap: 28px; }
.error-code { width: 76px; height: 76px; display: grid; place-items: center; border: 3px solid var(--white); border-radius: 50%; font-size: 42px; font-weight: 900; }
.text-button { padding: 0; border: 0; color: var(--white); background: none; font-weight: 900; cursor: pointer; }

.results {
  width: min(1180px, calc(100% - 48px));
  min-height: 720px;
  margin: 0 auto;
  padding: 64px 0 100px;
}

.result-topbar {
  min-height: 92px;
  margin-bottom: 22px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  color: var(--white);
  background: linear-gradient(110deg, var(--aqua), var(--teal) 60%, var(--teal-deep));
  box-shadow: 0 16px 45px rgba(14, 116, 116, .15);
}

.result-topbar::after {
  content: "";
  width: 180px;
  height: 180px;
  position: absolute;
  right: 110px;
  top: -115px;
  border: 28px solid rgba(255,255,255,.1);
  border-radius: 50%;
}

.file-identity { min-width: 0; display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.pdf-stamp { flex: none; padding: 9px 8px 7px; border-radius: 7px; color: var(--white); background: linear-gradient(135deg, var(--coral), var(--pink)); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.file-identity h2 { max-width: 720px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; letter-spacing: -.025em; }
.file-identity p { margin: 5px 0 0; color: rgba(255,255,255,.78); font-size: 11px; }

.outline-button {
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  color: var(--white);
  background: rgba(255,255,255,.12);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: background .2s ease;
}
.outline-button:hover { background: rgba(255,255,255,.22); }
.outline-button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

.dashboard-grid { display: block; }

.report-card {
  min-height: 650px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(19, 128, 126, .1);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 18px 60px rgba(23, 83, 83, .09);
}

.report-card::before {
  content: "";
  width: 90px;
  height: 8px;
  position: absolute;
  top: 0;
  left: 28px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, var(--aqua), var(--teal));
}

.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.card-heading h3 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.card-heading .eyebrow { margin-bottom: 8px; color: var(--teal-deep); opacity: 1; }

.unit-switch { padding: 3px; display: flex; border: 1px solid rgba(22,184,180,.3); border-radius: 12px; background: var(--soft); }
.unit-switch button { min-width: 58px; height: 30px; padding: 0 10px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.unit-switch button.active { color: var(--white); background: var(--teal); box-shadow: 0 6px 14px rgba(22,184,180,.2); }

.measurement-layout {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 30px;
  align-items: stretch;
}

.measure-stage {
  height: 530px;
  margin: 0;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(22,184,180,.14);
  border-radius: 22px;
  background: radial-gradient(circle at 50% 45%, rgba(22,184,180,.075), transparent 56%), var(--soft);
}
.paper-shape {
  width: 360px;
  height: 480px;
  max-width: 82%;
  max-height: 91%;
  position: relative;
  display: grid;
  place-items: center;
  border: 2px solid var(--teal);
  border-radius: 5px;
  background: linear-gradient(145deg, #fff, #f5fbfa);
  box-shadow: 12px 13px 0 rgba(22,184,180,.12), 13px 14px 0 rgba(22,184,180,.32);
  transition: width .35s ease, height .35s ease;
}
.paper-shape::before { content: ""; position: absolute; inset: 10px; border: 1px dashed rgba(22,184,180,.32); }
.pdf-preview { width: 100%; height: 100%; position: absolute; inset: 0; z-index: 1; object-fit: contain; background: var(--white); }
.preview-placeholder { position: absolute; top: 30px; z-index: 1; color: rgba(7,159,158,.48); font-size: 8px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.paper-shape.has-preview::before { z-index: 2; border-color: rgba(22,184,180,.22); pointer-events: none; }
.registration-mark { position: absolute; z-index: 4; color: var(--pink); font: 17px/1 monospace; }
.registration-mark.top-left { left: -18px; top: -18px; }
.registration-mark.bottom-right { right: -18px; bottom: -18px; }

.measure-rule { position: absolute; }
.measure-rule::before, .measure-rule::after { content: ""; position: absolute; background: rgba(22,184,180,.36); }
.measure-rule.horizontal { width: min(380px, 82%); height: 12px; top: 8px; border-top: 1px solid rgba(22,184,180,.36); }
.measure-rule.horizontal::before, .measure-rule.horizontal::after { width: 1px; height: 7px; top: -4px; }
.measure-rule.horizontal::before { left: 0; }.measure-rule.horizontal::after { right: 0; }
.measure-rule.vertical { width: 12px; height: 300px; max-height: 78%; left: 10px; border-left: 1px solid rgba(22,184,180,.36); }
.measure-rule.vertical::before, .measure-rule.vertical::after { width: 7px; height: 1px; left: -4px; }
.measure-rule.vertical::before { top: 0; }.measure-rule.vertical::after { bottom: 0; }

.measurement-summary {
  min-width: 0;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(22,184,180,.18);
  border-radius: 22px;
  background: linear-gradient(155deg, #ffffff 0%, #f2fbfa 100%);
}
.measurement-summary .eyebrow { margin-bottom: 34px; color: var(--teal-deep); opacity: 1; }
.dimension-labels, .dimension-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 12px; }
.dimension-labels { margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.dimension-labels span:first-child { text-align: right; }
.dimension-row strong { min-width: 0; color: var(--navy); font-size: clamp(40px, 4vw, 60px); line-height: 1; letter-spacing: -.06em; white-space: nowrap; }
.dimension-row strong:first-child { text-align: right; }
.dimension-row > span { color: var(--coral); font-size: 30px; font-weight: 900; }
.dimension-unit { margin-top: 16px; color: var(--teal-deep); font-size: 12px; font-weight: 900; letter-spacing: .16em; text-align: center; text-transform: uppercase; }
.summary-divider { height: 1px; margin: 34px 0 24px; background: var(--line); }
.size-foot { min-height: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 11px; color: var(--muted); font-size: 10px; }
.size-foot span:last-child { width: 100%; color: var(--teal-deep); font-weight: 800; }
.box-tag { padding: 6px 9px; border-radius: 7px; color: var(--white); background: var(--teal); font-size: 8px; font-weight: 900; letter-spacing: .06em; }

footer {
  min-height: 92px;
  width: 100%;
  padding: 0 max(28px, calc((100% - 1320px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--white);
  font-size: 9px;
}
footer img { width: 106px; height: auto; }
footer span { font-weight: 900; letter-spacing: .08em; }
footer p { text-align: center; }

@media (max-width: 900px) {
  .hero { min-height: 680px; }
  .report-card { min-height: 0; }
  .measurement-layout { grid-template-columns: 1fr; }
  .measure-stage { height: 480px; }
  .measurement-summary { min-height: 290px; }
}

@media (max-width: 620px) {
  .site-header { height: 78px; padding-inline: 18px; }
  .brand img { width: 132px; }
  .local-pill { min-height: 34px; padding: 0 12px; font-size: 8px; }
  .hero { min-height: 650px; padding: 46px 14px 92px; }
  .hero h1 { font-size: 48px; }
  .intro { font-size: 13px; }
  .drop-shell { margin-top: 30px; }
  .drop-zone { min-height: 265px; padding: 34px 18px; }
  .drop-title { font-size: 20px; }
  .privacy-note { padding: 0 16px; text-align: center; }
  .results { width: min(100% - 28px, 1180px); padding: 34px 0 70px; }
  .result-topbar { align-items: flex-start; }
  .file-identity h2 { max-width: 170px; }
  .outline-button { width: 42px; padding: 0; justify-content: center; font-size: 0; }
  .report-card { min-height: 0; padding: 20px; }
  .card-heading { gap: 10px; }
  .measurement-layout { margin-top: 20px; gap: 18px; }
  .measure-stage { height: 390px; border-radius: 17px; }
  .paper-shape { max-width: 84%; max-height: 88%; }
  .measurement-summary { min-height: 250px; padding: 24px 18px; border-radius: 17px; }
  .measurement-summary .eyebrow { margin-bottom: 24px; }
  .dimension-row { column-gap: 8px; }
  .dimension-row strong { font-size: clamp(35px, 12vw, 52px); }
  .dimension-row > span { font-size: 25px; }
  .summary-divider { margin: 26px 0 20px; }
  footer { padding-inline: 18px; }
  footer p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
