/* Touch of Maine, touchofmaine.com. Brand: night navy, pine-ground black, cream, gold; Cormorant Garamond + Sora. */
:root {
  --night: #0a1029;
  --deep: #03050d;
  --panel: #111a42;
  --cream: #efe7d6;
  --cream-2: #e2d7c0;
  --gold: #d8b46a;
  --soft-on-night: #cfc7b4;
  --soft-on-cream: #464b60;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Sora", "Segoe UI", system-ui, sans-serif;

  --t-display: clamp(46px, 5.6vw, 96px);
  --t-h2: clamp(34px, 3.4vw, 56px);
  --t-lead: clamp(21px, 1.75vw, 27px);
  --t-body: 17px;
  --t-small: 14px;

  --m: clamp(16px, 2.4vw, 36px);
  --gap: clamp(120px, 14vw, 200px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--cream); font: 400 var(--t-body)/1.55 var(--sans); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--t-display); line-height: 0.98; letter-spacing: -0.02em; }
h2 { font-size: var(--t-h2); line-height: 1.02; }
h3 { font-size: var(--t-lead); line-height: 1.15; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
::selection { background: var(--gold); color: var(--night); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px;
  background: var(--night); color: var(--cream); border: 0; border-radius: 0; font: 600 var(--t-body)/1 var(--sans);
  text-decoration: none; cursor: pointer; transition: transform .18s var(--ease), background-color .18s var(--ease), color .18s var(--ease);
}
.btn:hover { background: #1a2558; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn.gold { background: var(--gold); color: var(--night); }
.btn.gold:hover { background: #e6c784; }
.btn.quiet { background: var(--cream-2); color: var(--night); }
.btn.quiet:hover { background: #d6c9ad; }

/* ---------------------------------------------------------------- hero: the sheet and the stage */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 12px; align-items: start; }
.sheet { background: var(--cream); color: var(--night); padding: 28px clamp(24px, 4vw, 64px) 72px; min-height: calc(100svh - 24px); }
.topnav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; font-size: var(--t-small); }
.topnav a { text-decoration: none; padding: 10px 0; }
.topnav a:hover { text-decoration: underline; }
.topnav a:first-child { justify-self: start; }
.topnav a:last-child { justify-self: end; }
.topnav .mark, .phonebar .mark { font: 600 var(--t-lead)/1 var(--serif); letter-spacing: .02em; text-decoration: none; }
.phonebar { display: none; }
.intro { text-align: center; max-width: 34rem; margin: 22svh auto 0; }
.intro h1 { color: var(--night); }
.lede { margin: 36px auto 0; max-width: 40ch; font-size: var(--t-body); }
.price { margin: 18px auto 30px; font-size: var(--t-small); color: var(--soft-on-cream); }

.make { max-width: 30rem; margin: var(--gap) auto 0; }
.make h2 { text-align: center; }
.make-note { text-align: center; margin: 18px auto 32px; max-width: 38ch; }
.narrow-only { display: none; }
.skyform { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.skyform .full { grid-column: 1 / -1; }
.skyform label { display: grid; gap: 6px; font-size: var(--t-small); font-weight: 600; }
.skyform input:not([type=radio]), .skyform select {
  width: 100%; min-height: 50px; padding: 0 14px; border: 0; border-bottom: 2px solid var(--night); border-radius: 0;
  background: var(--cream-2); color: var(--night); font: 400 var(--t-body)/1.2 var(--sans); appearance: none;
}
.skyform select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230a1029' stroke-width='2'/%3E%3C/svg%3E");
  background-position: calc(100% - 16px) 50%; background-repeat: no-repeat; padding-right: 40px; }
.skyform input::placeholder { color: #6b6f80; }
.skyform input:focus, .skyform select:focus { outline: none; background-color: #d9cdb3; }
.styles { border: 0; margin: 4px 0 0; padding: 0; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.styles legend { float: left; font-size: var(--t-small); font-weight: 600; margin-right: 8px; padding: 0; }
.pick { display: inline-flex !important; grid-auto-flow: column; align-items: center; gap: 8px; font-weight: 400 !important; font-size: var(--t-body) !important; cursor: pointer; }
.pick input { width: 20px; height: 20px; accent-color: var(--night); margin: 0; }
.skyform .btn { margin-top: 8px; }
.status { min-height: 1.5em; font-size: var(--t-small); text-align: center; }
.status.err { color: #8a2d1f; font-weight: 600; }
.result { margin-top: 28px; background: var(--cream-2); padding: 24px; }
.result-head { font-weight: 600; }
.result-text { margin: 10px 0 18px; font-size: var(--t-small); overflow-wrap: anywhere; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.small { font-size: var(--t-small); margin-top: 14px; color: var(--soft-on-cream); }

.stage { position: sticky; top: 12px; height: calc(100svh - 24px); background: var(--deep); overflow: hidden; }
.frames { position: absolute; inset: 0 0 56px 0; }
.frame { position: absolute; inset: 5% 7%; margin: 0; display: grid; place-items: center; opacity: 0; transition: opacity 1.6s ease; }
.frame.is-on { opacity: 1; }
.frame img { width: auto; height: 100%; max-width: 100%; object-fit: contain; aspect-ratio: 4 / 5; }
.paper { position: absolute; left: 50%; top: 50%; width: 640px; height: 800px; transform: translate(-50%, -50%) scale(var(--k, .6)); transform-origin: center; }
.paper iframe { width: 640px; height: 800px; border: 0; display: block; background: var(--night); }
html.no-js .frame.live { display: none; }
html.no-js .frame.first { opacity: 1; }
.bar { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: var(--cream); color: var(--night);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; font-size: var(--t-small); }
.bar span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar span:last-child { text-align: right; }
.bar-order { display: none; }

/* ---------------------------------------------------------------- styles: square plate, spare text */
.plate { display: grid; grid-template-columns: 1fr 1fr; min-height: 88svh; background: var(--panel); margin: 0 12px; }
.plate-img { position: relative; margin: 40px; align-self: center; aspect-ratio: 1; }
.plate-img .pl { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease; }
.plate-img .pl.is-on { opacity: 1; }
.plate-text { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: 56px var(--m) 56px 24px; }
.tabs { display: flex; gap: 28px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 6px 0; color: var(--soft-on-night); font: 400 var(--t-body)/1.2 var(--sans); cursor: pointer; text-decoration: none; }
.tabs button[aria-selected="true"] { color: var(--gold); font-weight: 600; text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 2px; }
.tabs button:hover { color: var(--cream); }
.plate-copy { max-width: 36ch; }
.plate-copy p { margin-top: 20px; }
.plate-copy .tab-line { margin-top: 32px; font-size: var(--t-lead); font-family: var(--serif); line-height: 1.25; }
.cells { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cell { display: flex; align-items: center; padding: 0 22px; height: 72px; font-weight: 600; text-decoration: none; transition: background-color .18s var(--ease), transform .18s var(--ease); }
.cell:active { transform: scale(.99); }
.cell.gold { background: var(--gold); color: var(--night); }
.cell.gold:hover { background: #e6c784; }
.cell.tone { background: #1d2a63; color: var(--cream); }
.cell.tone:hover { background: #26357a; }

/* ---------------------------------------------------------------- how it works: the slip */
.how { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; background: var(--deep);
  padding: 120px var(--m) 140px; margin: 12px 12px 0; }
.clip { margin: 48px 0 0; }
.clip video { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #000; display: block; }
.clip figcaption { margin-top: 12px; font-size: var(--t-small); color: var(--soft-on-night); max-width: 52ch; }
.how-text { grid-column: 1 / span 5; }
.how-text p { margin-top: 28px; max-width: 34ch; font-size: var(--t-lead); font-family: var(--serif); line-height: 1.3; }
.slip { grid-column: 7 / span 6; max-width: 580px; background: var(--cream); color: var(--night); padding: 34px 30px 44px;
  font-variant-numeric: tabular-nums; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 95% 100%, 90% calc(100% - 14px), 85% 100%, 80% calc(100% - 14px), 75% 100%, 70% calc(100% - 14px), 65% 100%, 60% calc(100% - 14px), 55% 100%, 50% calc(100% - 14px), 45% 100%, 40% calc(100% - 14px), 35% 100%, 30% calc(100% - 14px), 25% 100%, 20% calc(100% - 14px), 15% 100%, 10% calc(100% - 14px), 5% 100%, 0 calc(100% - 14px)); }
.slip h3 { font: 600 var(--t-body)/1.3 var(--sans); margin-top: 28px; }
.slip h3:first-child { margin-top: 0; }
.slip .row { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; font-size: var(--t-body); }
.slip .row span { flex: 0 1 auto; }
.slip .row i { flex: 1 1 24px; min-width: 24px; height: 0; align-self: center; margin-top: 8px; border-bottom: 4px dotted var(--night); opacity: .5; }
.slip .row b { flex: none; font-weight: 600; white-space: nowrap; }
.slip .row.total { margin: 30px -30px 0; padding: 0 30px; min-height: 48px; align-items: center; background: var(--night); color: var(--cream); }
.slip .row.total i { border-bottom-color: var(--cream); }

/* ---------------------------------------------------------------- the catalogue: pinned heading, passing rows */
.shop { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; background: var(--gold); color: var(--night);
  padding: 120px var(--m) 160px; }
.pin { grid-column: 1 / span 5; align-self: start; position: sticky; top: 40px; font-size: var(--t-display); line-height: .98; letter-spacing: -0.02em; }
.blocks { grid-column: 7 / span 6; display: grid; gap: 104px; }
.block h3 { font-size: var(--t-h2); }
.blurb { margin-top: 14px; max-width: 44ch; }
.pair { display: grid; grid-template-columns: minmax(140px, 190px) 1fr; gap: 28px; margin-top: 24px; align-items: start; }
.block.flip .pair { grid-template-columns: 1fr minmax(140px, 190px); }
.block.flip .pair img { order: 2; }
.pair img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.pair ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-size: var(--t-body); line-height: 1.4; }
.pair li a { font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; transition: color .15s; }
.pair li a:hover { color: #3a2a06; text-decoration-thickness: 3px; }
.cost { white-space: nowrap; }

/* ---------------------------------------------------------------- Winslow: photo, colour tile, facts */
.about { padding: var(--gap) var(--m) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 16px; }
.about-head { grid-column: 1 / span 7; }
.about-head .lead { margin-top: 24px; font-size: var(--t-lead); font-family: var(--serif); line-height: 1.3; max-width: 46ch; }
.tiles { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 16px; margin-top: 72px; align-items: start; }
.photo { grid-column: 1 / span 8; margin: 0; position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.photo figcaption { position: absolute; top: 0; right: 0; width: 320px; padding: 20px; background: var(--cream); color: var(--night); font-size: var(--t-small); line-height: 1.5; }
.maine { grid-column: 9 / span 4; }
.tile { background: var(--panel); aspect-ratio: 8 / 8; display: grid; place-items: center; padding: 28px; }
.tile svg { height: 100%; width: auto; max-width: 100%; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 16px; margin: 24px 0 0; }
.facts dt { font-size: var(--t-small); color: var(--soft-on-night); }
.facts dd { margin: 4px 0 0; font-size: var(--t-body); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- questions as reading text */
.faq { padding: var(--gap) var(--m) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.faq h2 { grid-column: 1 / span 3; }
.answers { grid-column: 5 / span 8; columns: 2; column-gap: 56px; }
.answers p { break-inside: avoid; margin: 0 0 20px; line-height: 1.55; }
.answers b { font-weight: 600; color: var(--gold); }
.answers a { color: var(--cream); }

/* ---------------------------------------------------------------- the last sentence */
.cta { padding: 30svh var(--m) 22svh; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.cta-line, .cta-actions { grid-column: 5 / span 7; }
.cta-line { font: 400 var(--t-lead)/1.4 var(--sans); max-width: 34ch; letter-spacing: 0; }
.cta-actions { display: flex; align-items: center; gap: 24px; margin-top: 24px; }
.cta .btn { min-height: 44px; padding: 0 18px; }
.textlink { font-weight: 600; }
.textlink:hover { color: var(--gold); }

/* ---------------------------------------------------------------- footer: the name across the last photograph */
.foot { position: relative; min-height: 100svh; overflow: hidden; color: var(--cream); display: flex; flex-direction: column; justify-content: space-between; }
.foot-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.62); z-index: -1; transform-origin: 50% 60%; }
.foot { isolation: isolate; }
.foot-top { display: flex; justify-content: space-between; gap: 24px; padding: 32px var(--m) 0; }
.foot-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-links a, .foot-contact a { text-decoration: none; }
.foot-links a:hover, .foot-contact a:hover { text-decoration: underline; }
.foot-contact { text-align: right; }
.foot-bottom { padding: 0 var(--m) 28px; }
.wordmark { font: 600 15.9vw/0.9 var(--serif); letter-spacing: -0.03em; white-space: nowrap; margin: 0 0 22px -0.04em; }
.legal { font-size: var(--t-small); line-height: 1.5; max-width: 52ch; }

/* ---------------------------------------------------------------- motion */
.js [data-rise] > * { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js [data-rise].in > * { opacity: 1; transform: none; }
.js [data-rise].in > *:nth-child(2) { transition-delay: .08s; }
.js [data-rise].in > *:nth-child(3) { transition-delay: .16s; }
.js [data-rise].in > *:nth-child(4) { transition-delay: .24s; }
.js [data-rise].in > *:nth-child(n+5) { transition-delay: .3s; }
@keyframes drift { from { transform: scale(1.02) translateY(0); } to { transform: scale(1.1) translateY(-2%); } }
.foot-photo { animation: drift 40s ease-in-out infinite alternate; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-rise] > * { opacity: 1; transform: none; transition: none; }
  .frame, .plate-img .pl { transition: none; }
  .foot-photo { animation: none; }
}

/* ---------------------------------------------------------------- phone and tablet */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 0 12px 12px; gap: 0; }
  .phonebar { order: -2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; }
  .phonebar .btn { min-height: 44px; padding: 0 16px; background: var(--gold); color: var(--night); }
  .topnav { display: none; }
  .stage { order: -1; position: sticky; top: 0; height: 56svh; z-index: 0; }
  .sheet { position: relative; z-index: 1; min-height: 0; padding: 22px 20px 56px; }
  .intro { margin-top: 28px; }
  .intro h1 { font-size: clamp(40px, 11vw, 64px); }
  .wide-only { display: none; }
  .narrow-only { display: inline; }
  .make { margin-top: 96px; }
  .bar { height: 60px; padding: 0 14px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; line-height: 1.35; }
  .bar span, .bar span:last-child { text-align: left; max-width: 100%; }
  .bar.has-order { padding-right: 150px; }
  .bar.has-order .bar-order { display: inline-flex; position: absolute; right: 8px; top: 8px; min-height: 44px; padding: 0 14px; background: var(--night); color: var(--cream); font-size: var(--t-small); }
  .frames { bottom: 60px; }
  .plate { grid-template-columns: 1fr; min-height: 0; margin: 0; }
  .plate { display: flex; flex-direction: column; padding: 40px 16px 40px; gap: 24px; }
  .plate-text { display: contents; }
  .plate-copy { order: 1; max-width: none; }
  .tabs { order: 2; }
  .plate-img { order: 3; margin: 0; align-self: stretch; width: 100%; }
  .cells { order: 4; }
  .cells { grid-template-columns: 1fr; }
  .cell { height: 60px; }
  .how { display: block; padding: 88px 16px 96px; margin: 0; }
  .slip { margin-top: 44px; max-width: none; padding: 28px 20px 64px; }
  .slip .row { flex-wrap: wrap; }
  .slip .row span { flex-basis: 100%; }
  .slip .row i { flex: 1 1 auto; }
  .slip .row.total { margin: 26px -20px 0; padding: 10px 20px; }
  .slip .row.total span { flex-basis: auto; }
  .shop { display: block; padding: 0 16px 96px; }
  .pin { position: sticky; top: 0; z-index: 2; background: var(--gold); font-size: 9vw; padding: 14px 0 12px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .blocks { gap: 104px; padding-top: 28px; }
  .pair, .block.flip .pair { grid-template-columns: 1fr; }
  .block.flip .pair img { order: 0; }
  .pair img { aspect-ratio: 4 / 3; object-position: 50% 72%; }
  .about, .faq { display: block; padding: 96px 16px 0; }
  .about-head .lead { max-width: 60ch; }
  .tiles { display: block; margin-top: 40px; }
  .photo { aspect-ratio: 4 / 3; overflow: visible; }
  .photo img { height: 100%; }
  .photo figcaption { position: static; width: auto; margin-top: 0; }
  .maine { margin-top: 56px; }
  .tile { aspect-ratio: 3 / 2; }
  .faq h2 { font-size: 32px; }
  .answers { columns: 1; margin-top: 28px; }
  .cta { display: block; padding: 20svh 20px 14svh; }
  .cta-line { max-width: none; }
  .foot { min-height: 88svh; }
  .foot-top { flex-direction: column; }
  .foot-contact { text-align: left; }
}
@media (max-width: 900px) and (min-width: 600px) {
  .stage { height: 64svh; }
}
