/* Milpitas Alteration Center — "Pattern paper" */
:root {
  --paper: #F3EBD8;
  --tissue: #F8F2E3;
  --ink: #222222;
  --red: #C8102E;
  --blue: #1F3A93;
  --kraft: #9A8F7A;
  --kraft-ink: #625945;
  --cta: #0E6E5C;
  --ease: cubic-bezier(.22,1,.36,1);
  --sans: "Epilogue", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Space Mono", ui-monospace, Menlo, Consolas, monospace;
  --dash: repeating-linear-gradient(45deg, var(--ink) 0 5px, transparent 5px 10px);
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); font: 400 17px/1.6 var(--sans);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle, rgb(154 143 122 / .55) 1.1px, transparent 1.6px);
  background-size: 24px 24px;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 14px; }
.skip:focus { top: 44px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- scissors cut line (scroll progress) ---------- */
.cutline { position: fixed; z-index: 45; left: 0; right: 0; bottom: calc(68px + env(safe-area-inset-bottom)); height: 26px; pointer-events: none;
  background: linear-gradient(90deg, var(--ink) 55%, transparent 0) 0 50% / 11px 1.5px repeat-x; }
.cut-done { position: absolute; left: 0; top: calc(50% - 1px); height: 2px; width: calc(var(--scroll, 0) * 100%); background: var(--red); }
.scissors { position: absolute; left: 0; top: -3px; width: 36px; height: 32px; transform: translateX(calc(var(--scroll, 0) * (100vw - 36px))); background: radial-gradient(circle, var(--paper) 55%, transparent 56%); }
.scissors .blade-a, .scissors .blade-b { transform-origin: 20px 16px; }
.is-cutting .scissors .blade-a { animation: snipA .32s ease-in-out infinite alternate; }
.is-cutting .scissors .blade-b { animation: snipB .32s ease-in-out infinite alternate; }
@keyframes snipA { to { transform: rotate(7deg); } }
@keyframes snipB { to { transform: rotate(-7deg); } }

/* ---------- header ---------- */
.hd { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; min-height: 44px; }
.logo svg { width: 40px; height: 40px; flex: none; }
.logo span { font: 500 13px/1.15 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.logo b { font: 800 16px/1.1 var(--sans); letter-spacing: -.01em; text-transform: none; }
.nav { display: none; }
.hd-call { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 22px; font: 700 16px/1.1 var(--sans); text-decoration: none; border: 0; cursor: pointer; border-radius: 2px; transition: transform .35s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn-cta { background: var(--cta); color: #fff; }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }

/* ---------- pattern pieces ---------- */
.piece { position: relative; margin: 22px 10px; padding: 2px; background: var(--dash); clip-path: var(--shape); }
.piece > .pin { position: relative; clip-path: var(--shape); background: var(--tissue); padding: 30px 22px 44px; }
.mark { font: 400 12.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin: 0 0 18px; }
.mark-tl { text-align: center; }
.kick { font: 700 13px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin: 0 0 12px; }
h1 { font: 800 clamp(40px, 11.5vw, 104px)/.92 var(--sans); letter-spacing: -.045em; margin: 0 0 18px; text-wrap: balance; }
h2 { font: 800 clamp(32px, 8.4vw, 64px)/.98 var(--sans); letter-spacing: -.04em; margin: 0 0 12px; }
h3 { font: 800 19px/1.2 var(--sans); margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.lede { font-size: 19px; max-width: 36ch; margin: 0 0 24px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pencil { font: 700 14px/1.3 var(--mono); color: var(--red); transform: rotate(-3deg); }
.pencil-cta { margin: 14px 0 0 8px; }
.grain, .fold { display: none; }
.fine { font-size: 14px; color: var(--kraft-ink); margin: 14px 16px 0; }

/* hero piece */
.p-hero { --shape: polygon(0 36px, 36% 0, 64% 0, 100% 36px, 100% calc(42% - 10px), calc(100% - 12px) 42%, 100% calc(42% + 10px), 100% 100%, 0 100%, 0 calc(42% + 10px), 12px 42%, 0 calc(42% - 10px)); margin-top: 6px; }
.p-hero > .pin { padding-top: 54px; }
.hero-fig { position: relative; margin: 28px 0 0; }
.hero-fig img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; clip-path: polygon(0 0, 100% 0, 100% 100%, 54% 100%, 50% calc(100% - 14px), 46% 100%, 0 100%); }
.hero-fig figcaption { font: 400 12.5px var(--mono); color: var(--kraft-ink); margin-top: 6px; }

/* menu piece */
.p-menu { --shape: polygon(0 64px, 8% 34px, 22% 12px, 38% 3px, 46% 1px, 50% 14px, 54% 1px, 62% 3px, 78% 12px, 92% 34px, 100% 64px, 100% calc(56% - 10px), calc(100% - 12px) 56%, 100% calc(56% + 10px), 100% 100%, 0 100%, 0 calc(56% + 10px), 12px 56%, 0 calc(56% - 10px)); }
.p-menu > .pin { padding-top: 64px; }
.head { position: relative; margin-bottom: 22px; }
.pencil-tag { position: relative; display: inline-block; margin: 4px 0 0; padding: 10px 22px; }
.pencil-tag svg { position: absolute; inset: -4px -10px; width: calc(100% + 20px); height: calc(100% + 8px); overflow: visible; }
.pencil-tag path { stroke-dasharray: 520; stroke-dashoffset: 520; }
.is-in .pencil-tag path, html:not(.js) .pencil-tag path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s var(--ease) .3s; }
.menu-grid { display: grid; gap: 24px; }
.menu-col ul { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.menu-col li { display: flex; align-items: baseline; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--kraft); }
.menu-col li i { flex: 1; min-width: 12px; }
.menu-col li b { font: 700 15px var(--mono); }
.notch-n { display: inline-grid; place-items: center; width: 30px; height: 26px; background: var(--red); color: #fff; font: 700 13px var(--mono); clip-path: polygon(0 0, 100% 0, 100% 100%, 60% 100%, 50% 70%, 40% 100%, 0 100%); }

/* estimate piece */
.p-est { --shape: polygon(24px 0, calc(100% - 24px) 0, 100% 24px, 100% calc(100% - 24px), calc(100% - 24px) 100%, 24px 100%, 0 calc(100% - 24px), 0 calc(22% + 22px), 12px calc(22% + 14px), 0 calc(22% + 6px), 0 calc(22% - 6px), 12px calc(22% - 14px), 0 calc(22% - 22px), 0 24px); }
.sub { margin: 0; max-width: 52ch; color: #4a4a4a; }
.est { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.est > *, .est-fields > * { min-width: 0; }
.est-fields { display: grid; gap: 24px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .photo > label { font: 800 17px/1.25 var(--sans); margin-bottom: 12px; padding: 0; display: flex; align-items: center; gap: 10px; }
.n { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1.5px solid var(--red); border-radius: 50%; color: var(--red); font: 700 13px var(--mono); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { width: 100%; }
.chips label, .remind label { position: relative; }
.chips input, .remind input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chips label > span, .remind label > span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1.5px dashed var(--ink); background: var(--paper); font: 500 15px var(--sans); transition: background-color .3s var(--ease), color .3s var(--ease); }
.chips input:checked + span, .remind input:checked + span { background: var(--ink); color: var(--paper); border-style: solid; }
.chips-alt input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.chips-alt input:checked + span::before { content: "✂"; }
.chips input:focus-visible + span, .remind input:focus-visible + span, .check input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
input[type="file"] { font: 400 16px var(--sans); padding: 12px; border: 1.5px dashed var(--kraft-ink); background: var(--paper); max-width: 100%; }
#e-prev { max-height: 220px; width: auto; margin-top: 10px; border: 8px solid #fff; box-shadow: 0 0 0 1px var(--kraft); transform: rotate(-2deg); }
.photo small { display: block; margin-top: 6px; color: var(--kraft-ink); font-size: 13.5px; }
.fit { display: grid; gap: 14px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; position: relative; cursor: pointer; font-weight: 600; }
.check input { position: absolute; opacity: 0; width: 44px; height: 44px; margin: 0; left: 0; cursor: pointer; }
.check span::before { content: ""; display: inline-block; vertical-align: -6px; width: 24px; height: 24px; margin-right: 12px; border: 1.5px solid var(--ink); background: var(--paper); }
.check input:checked + span::before { background: var(--red); box-shadow: inset 0 0 0 4px var(--paper); }
.when { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.remind { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.remind-l { width: 100%; font-weight: 600; font-size: 15px; }
.who { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.who label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
input[type="text"], input[type="tel"], select { width: 100%; min-height: 50px; padding: 10px 12px; font: 400 16px/1.4 var(--sans); color: var(--ink); background: #fff; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; }
.est-out { position: relative; background: #E9DCC0; padding: 22px 20px 24px; border: 1.5px dashed var(--kraft-ink); align-self: start; }
.est-out::before { content: ""; position: absolute; top: -1.5px; left: 50%; width: 70px; height: 16px; margin-left: -35px; background: var(--tissue); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.est-out .mark { color: #A00C25; }
.est-k { margin: 0; font: 700 13px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--kraft-ink); }
.est-v { margin: 4px 0; font: 800 clamp(38px, 11vw, 60px)/1 var(--sans); letter-spacing: -.04em; }
.est-t { margin: 0 0 12px; font-weight: 600; color: var(--blue); }
.est-list { list-style: none; margin: 0 0 12px; padding: 10px 0; border-top: 1px dashed var(--kraft-ink); border-bottom: 1px dashed var(--kraft-ink); font: 400 14px/1.6 var(--mono); }
.est-note { margin: 0 0 16px; font-size: 14px; color: #4a4434; }
.est-out .btn { width: 100%; }
.confirm { margin: 14px 0 0; padding: 12px 14px; background: var(--cta); color: #fff; font-weight: 600; }

/* ---------- portfolio rail ---------- */
.portfolio { padding: 40px 0 20px; }
.pf-head { padding: 0 16px; margin-bottom: 18px; }
.rail { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 16px 16px; scrollbar-width: thin; scrollbar-color: var(--red) transparent; }
.sw { position: relative; flex: none; width: 66vw; max-width: 340px; margin: 0; scroll-snap-align: start; }
.sw.s2, .sw.s4 { width: 78vw; max-width: 460px; }
.sw img { width: 100%; height: 300px; object-fit: cover; clip-path: var(--shape); cursor: zoom-in; position: relative; z-index: 1; }
.sw::before { content: ""; position: absolute; left: -2px; top: -2px; width: calc(100% + 4px); height: 304px; background: var(--dash); clip-path: var(--shape); }
.sw figcaption { margin-top: 10px; font: 400 13px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.sw figcaption b { color: var(--red); margin-right: 6px; }
.s1 { --shape: polygon(12% 9%, 50% 0, 88% 9%, 100% 100%, 0 100%); }
.s2 { --shape: polygon(0 16%, 50% 0, 100% 16%, 100% 100%, 0 100%); }
.s3 { --shape: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%); }
.s4 { --shape: polygon(0 0, 100% 0, 93% 100%, 7% 100%); }
.s5 { --shape: polygon(0 12%, 34% 0, 66% 0, 100% 12%, 100% 100%, 0 100%); }
.s6 { --shape: polygon(0 0, 100% 0, 100% 100%, 22% 100%, 0 82%); }

/* ---------- steps ---------- */
.steps { padding: 20px 16px; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; position: relative; }
.steps li { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.steps b { flex: none; display: grid; place-items: center; width: 44px; height: 44px; background: var(--ink); color: var(--paper); font: 700 16px var(--mono); clip-path: polygon(0 0, 100% 0, 100% 100%, 62% 100%, 50% 80%, 38% 100%, 0 100%); }

/* ---------- visit piece ---------- */
.p-visit { --shape: polygon(5% 0, 95% 0, 100% 100%, 54% 100%, 50% calc(100% - 14px), 46% 100%, 0 100%); }
.p-visit > .pin { padding-left: calc(5% + 18px); padding-right: calc(5% + 18px); }
.v-grid { display: grid; gap: 14px; }
.v-item { padding: 16px 0; border-top: 1.5px solid var(--ink); }
.v-l { margin: 0 0 6px; font: 700 12.5px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.v-b { margin: 0 0 12px; font: 800 24px/1.2 var(--sans); letter-spacing: -.02em; }
.v-b a { text-decoration: none; }
.v-s { margin: 0; color: #4a4a4a; }
.hours dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.hours dt { font-weight: 600; }
.hours dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 15px; }

/* ---------- footer + dock ---------- */
.ft { margin: 30px 10px 0; padding: 26px 16px 30px; border-top: 2px dashed var(--ink); display: grid; gap: 10px; }
.ft p { margin: 0; }
.ft-name { font: 800 26px/1.1 var(--sans); letter-spacing: -.03em; }
.pv-note { color: #444; max-width: 72ch; }
.photo-credits { font-size: 14px; }
.photo-credits summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font: 700 14px var(--mono); }
.photo-credits ul { padding-left: 18px; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1.5px solid var(--ink); }
.dock a { display: flex; align-items: center; justify-content: center; min-height: 50px; font: 700 16px var(--sans); text-decoration: none; }
.dock-call { box-shadow: inset 0 0 0 2px var(--ink); }
.dock-cta { background: var(--cta); color: #fff; }

/* reveal */
html.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
html.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- ≥761 ---------- */
@media (min-width: 761px) {
  body { padding-bottom: 0; padding-left: 34px; }
  .dock { display: none; }
  .cutline { top: 40px; bottom: 0; right: auto; left: 0; width: 34px; height: auto; background: linear-gradient(var(--ink) 55%, transparent 0) 50% 0 / 1.5px 11px repeat-y; }
  .cut-done { left: calc(50% - 1px); top: 0; width: 2px; height: calc(var(--scroll, 0) * 100%); }
  .scissors { left: 0; top: 0; transform: translateY(calc(var(--scroll, 0) * (100vh - 76px))) rotate(90deg); }
  .hd { padding: 16px 28px; }
  .hd-call { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; box-shadow: inset 0 0 0 2px var(--ink); text-decoration: none; font-weight: 700; }
  .piece { margin: 30px 28px; }
  .piece > .pin { padding: 40px 56px 56px; }
  .p-hero > .pin { padding-top: 64px; }
  .p-menu > .pin { padding-top: 84px; }
  .p-visit > .pin { padding-left: calc(5% + 30px); padding-right: calc(5% + 30px); }
  .grain { display: block; position: absolute; right: 26px; top: 120px; bottom: 120px; width: 14px; }
  .grain i { position: absolute; left: 6px; top: 0; bottom: 0; width: 1.5px; background: var(--red); }
  .grain i::before, .grain i::after { content: ""; position: absolute; left: -5px; border: 6px solid transparent; }
  .grain i::before { top: -8px; border-bottom: 10px solid var(--red); border-top: 0; }
  .grain i::after { bottom: -8px; border-top: 10px solid var(--red); border-bottom: 0; }
  .grain em { position: absolute; left: 14px; top: 50%; font: 400 12px var(--mono); font-style: normal; letter-spacing: .2em; text-transform: uppercase; color: var(--red); writing-mode: vertical-rl; transform: translateY(-50%); }
  .fold { display: block; position: absolute; left: 16px; top: 150px; bottom: 60px; width: 16px; border: 1.5px solid var(--red); border-right: 0; font: 400 12px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
  .fold { writing-mode: vertical-rl; transform: rotate(180deg); padding: 0 0 0 18px; text-align: center; border-left: 0; border-right: 1.5px solid var(--red); }
  .menu-grid { grid-template-columns: 1fr 1fr; gap: 30px 40px; }
  .who { grid-template-columns: 1fr 1fr; }
  .v-grid { grid-template-columns: 1fr 1fr; gap: 0 30px; }
  .steps { padding: 30px 28px; }
  .steps ol { grid-template-columns: repeat(4, 1fr); }
  .steps ol::before { content: ""; position: absolute; left: 22px; right: 22px; top: 22px; border-top: 1.5px dashed var(--ink); }
  .steps li { flex-direction: column; align-items: flex-start; position: relative; }
  .pf-head, .rail { padding-left: 28px; padding-right: 28px; }
  .sw img { height: 380px; }
  .sw::before { height: 384px; }
  .ft { margin: 30px 28px 0; }
}
@media (min-width: 1000px) {
  .nav { display: flex; gap: 4px; margin-right: 8px; }
  .nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; font-weight: 600; }
  .nav a:hover { color: var(--red); }
  .p-hero > .pin { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding-right: 80px; }
  .p-hero .mark-tl { grid-column: 1 / -1; }
  .hero-fig { margin: 0; }
  .hero-fig img { aspect-ratio: 4 / 3; }
  .est { grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; }
  .est-out { position: sticky; top: 24px; }
}
@media (min-width: 1300px) {
  main, .ft { max-width: 1280px; margin-left: auto; margin-right: auto; }
  .piece { margin-left: 40px; margin-right: 40px; }
  .menu-grid { grid-template-columns: repeat(4, 1fr); }
  .v-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js [data-reveal] { opacity: 1; transform: none; }
}
