/* Maison Golay homepage feature: photo-to-website reveal and inquiry-flow preview.
   Default styles are the finished composition (no JS, reduced motion, or init failure).
   html.mg-motion switches the stage to a short sticky pullback driven by /js/mg-feature.js. */

/* Subset + static (weight 400) to the glyphs used in the inquiry preview panels. If that copy changes, re-subset. */
@font-face { font-family: "MG Jost"; src: url("/assets/clients/maison-golay/jost-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "MG Newsreader"; src: url("/assets/clients/maison-golay/newsreader-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }

.mg { --mg-cream: #f7f3ec; --mg-ink: #17130f; --mg-oxblood: #4a1214; --mg-rule: rgba(23, 19, 15, 0.22); }

/* ---------- Opening + reveal ---------- */
.mg-copy { padding-top: 20px; }
.mg-copy h1 { font: clamp(60px, 6.1vw, 108px)/0.91 var(--serif); letter-spacing: -0.065em; margin: 0; }
.mg-copy h1 i { display: block; font-size: 1.15em; }
.mg-copy .lead { max-width: 380px; }
.mg-credit { margin: 28px 0 0; display: grid; gap: 4px; justify-items: start; }
.mg-label { font: 700 0.75rem var(--sans); letter-spacing: 0.13em; text-transform: uppercase; color: var(--amber); }
.mg-name { font: 1.65rem/1.1 var(--serif); }
.mg-live, .mg-caption a { color: var(--cream); font-weight: 700; text-underline-offset: 4px; text-decoration-thickness: 1px; transition: color 160ms ease; }
.mg-live { display: inline-block; margin-top: 6px; padding: 6px 0; }
.mg-live:hover, .mg-caption a:hover { color: var(--amber); }

.mg-frame { margin: 28px 4vw 0; position: relative; max-width: 1240px; }
.mg-chrome { height: 34px; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: #2b241f; border-radius: 10px 10px 0 0; overflow: hidden; }
.mg-dots { display: flex; gap: 6px; }
.mg-dots i { width: 9px; height: 9px; border-radius: 50%; background: #5d5148; }
.mg-url { flex: 1; max-width: 320px; margin-inline: auto; text-align: center; font: 0.75rem var(--sans); color: #cbbfb1; background: #1f1a16; border-radius: 6px; padding: 4px 10px; }
.mg-view { position: relative; overflow: hidden; aspect-ratio: 1440 / 900; background: #120d0b; }
.mg-canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 0 0; }
.mg-canvas picture, .mg-canvas img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mg-photo { opacity: 0; }
.mg-caption { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; padding-top: 12px; font-size: 0.9rem; color: #cbbfb1; }

@media (max-width: 699px), (max-width: 1100px) and (orientation: portrait) {
  .mg-copy h1 { font-size: clamp(52px, 16vw, 72px); }
  .mg-copy h1 i { display: inline; font-size: 1.1em; }
  .mg-copy .lead { font-size: 1.05rem; margin-top: 16px; }
  .mg-credit { margin-top: 18px; grid-template-columns: auto auto; column-gap: 14px; align-items: baseline; }
  .mg-label { grid-column: 1 / -1; }
  .mg-name { font-size: 1.35rem; }
  .mg-frame { margin: 22px auto 0; width: min(78vw, 340px); }
  .mg-chrome { height: 24px; justify-content: center; border-radius: 18px 18px 0 0; }
  .mg-dots { display: none; }
  .mg-url { font-size: 0.66rem; padding: 2px 8px; max-width: 160px; }
  .mg-view { aspect-ratio: 390 / 844; border-radius: 0 0 18px 18px; }
  .mg-caption { font-size: 0.82rem; gap: 2px 12px; }
}

/* Motion mode: the stage sticks briefly while the photo pulls back into the page. */
html.mg-motion .mg-track { height: calc(100svh + 80svh); }
html.mg-motion .mg-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
html.mg-motion .mg-copy { position: relative; z-index: 2; will-change: opacity, transform; }
html.mg-motion .mg-frame { position: absolute; inset: 0; margin: 0; max-width: none; width: auto; z-index: 1; pointer-events: none; }
html.mg-motion .mg-view { position: absolute; inset: 0; aspect-ratio: auto; background: none; border-radius: 0; }
html.mg-motion .mg-canvas { will-change: transform; backface-visibility: hidden; }
html.mg-motion .mg-photo { opacity: 1; }
html.mg-motion .mg-page { will-change: opacity; }
html.mg-motion .mg-chrome { position: absolute; will-change: opacity; }
html.mg-motion .mg-caption { position: absolute; pointer-events: auto; padding-top: 0; }
@media (min-width: 1101px), (min-width: 700px) and (orientation: landscape) {
  html.mg-motion .mg-copy > * { max-width: calc((min(100vw, 1640px) - 8vw) * 0.39); }
}

/* ---------- Inquiry-flow preview ---------- */
.mg-flow { background: var(--cream); color: var(--ink); }
.mg-flow-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 6%; align-items: center; padding-block: clamp(56px, 7vw, 110px); }
.mg-flow .kicker { color: var(--brown); }
.mg-flow h2 { font: clamp(2.6rem, 4.6vw, 4.6rem)/0.95 var(--serif); letter-spacing: -0.05em; margin: 0; }
.mg-flow h2 i { display: block; }
.mg-flow .story { font-size: 1.15rem; line-height: 1.5; max-width: 30rem; margin: 22px 0 26px; color: #3e3630; }
.mg-switch { display: inline-flex; border: 1px solid var(--ink); }
.mg-switch button { min-height: 48px; padding: 0 20px; border: 0; background: transparent; color: var(--ink); font-weight: 700; transition: background-color 180ms ease, color 180ms ease; }
.mg-switch button + button { border-left: 1px solid var(--ink); }
.mg-switch button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.mg-switch button:hover:not([aria-pressed="true"]) { background: #e9e0d3; }
.mg-switch button:focus-visible { outline: 2px solid var(--brown); outline-offset: 3px; }
.mg-flow .plan { display: block; width: fit-content; margin-top: 22px; color: var(--green); font-weight: 700; text-underline-offset: 4px; }

.mg-form { background: var(--mg-cream, #f7f3ec); border: 1px solid #dcd2c4; padding: clamp(22px, 3vw, 40px); box-shadow: 0 18px 40px #3a2a1a14; }
.mg-form-note { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; font: 0.85rem var(--sans); color: #5a524a; }
.mg-form-note span { font: 600 0.75rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; border: 1px solid #5a524a; padding: 3px 7px; }
.mg-panels { display: grid; }
.mg-panel { grid-area: 1 / 1; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 26px 22px; align-content: start; transition: opacity 210ms ease, transform 210ms ease; }
.mg-panel:not(.is-active) { visibility: hidden; opacity: 0; transform: translateY(6px); }
.mg-panel > div { min-width: 0; }
.mg-panel .wide { grid-column: 1 / -1; }
.mg-panel dt { font: 400 0.8rem "MG Jost", var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: #4a1214; margin-bottom: 8px; }
.mg-panel dd { margin: 0; font: 1.08rem/1.3 "MG Newsreader", Georgia, serif; color: #17130f; padding-bottom: 9px; border-bottom: 1px solid rgba(23, 19, 15, 0.28); display: flex; justify-content: space-between; gap: 10px; }
.mg-panel dd.select::after { content: ""; flex: none; align-self: center; border: 5px solid transparent; border-top-color: #17130f; border-bottom: 0; }
@media (max-width: 750px) {
  .mg-flow-layout { grid-template-columns: 1fr; gap: 28px; }
  .mg-switch { display: flex; width: 100%; }
  .mg-switch button { flex: 1; padding: 0 10px; }
  .mg-panel { gap: 22px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .mg-panel, .mg-switch button, .mg-live { transition: none; }
}

/* Design studies section (moved below the feature) */
.studies { padding-block: clamp(48px, 6vw, 96px) 46px; }
.studies .intro h2 { font: clamp(2.8rem, 4.8vw, 5rem)/0.95 var(--serif); letter-spacing: -0.05em; margin: 0; }
.studies .intro h2 i { display: block; }
.studies .intro { padding-right: 8%; }

/* Finished composition (reduced motion / no JS) on wider screens: copy beside the browser frame. */
@media (min-width: 1101px), (min-width: 700px) and (orientation: landscape) {
  html:not(.mg-motion) .mg-stage { max-width: 1640px; margin: auto; padding: 20px 4vw 40px; display: grid; grid-template-columns: 39% 1fr; gap: 3%; align-items: start; }
  html:not(.mg-motion) .mg-copy { padding: 0; margin: 0; }
  html:not(.mg-motion) .mg-frame { margin: 0; }
}

/* Phone pullback: the frame stays put; only the canvas zoom and the page/bar opacity transition. */
@media (max-width: 699px), (max-width: 1100px) and (orientation: portrait) {
  .mg-frame { width: min(78vw, 420px, calc((100svh - 96px) * 390 / 844)); }
  html.mg-phone .mg-canvas { transform-origin: 65% 50%; transform: scale(1.85); transition: transform 900ms cubic-bezier(0.22, 0.61, 0.36, 1); will-change: transform; }
  html.mg-phone .mg-photo { opacity: 1; }
  html.mg-phone .mg-page { opacity: 0; transition: opacity 360ms ease 700ms; }
  html.mg-phone .mg-chrome { opacity: 0; transition: opacity 360ms ease 560ms; }
  html.mg-phone .mg-caption { opacity: 0; visibility: hidden; transition: opacity 360ms ease 560ms, visibility 0s linear 560ms; }
  html.mg-phone .is-revealed .mg-canvas { transform: none; }
  html.mg-phone .is-revealed .mg-page, html.mg-phone .is-revealed .mg-chrome, html.mg-phone .is-revealed .mg-caption { opacity: 1; }
  html.mg-phone .mg-frame:not(.is-revealed) .mg-page { transition-delay: 0ms; transition-duration: 200ms; }
}
