/* ring.css -- variant A ("Ring").
 *
 * Look follows the reference block (atelier-meridian "Never miss an opening"):
 * near-white field, tight grotesk headline in near-black, one solid button.
 * tokens.css still supplies the reset, easing curves and the reduced-motion
 * kill switch; the palette here is A's own and deliberately not the B sky.
 */

/* Metric-matched fallback: Helvetica Neue / Arial set ~5% wider than Inter
   Tight. When Google Fonts is slow or blocked, the headline would grow, the
   ring would have to re-fit around it, and on small phones it can't. Scaling
   the fallback keeps the copy the same width either way. */
@font-face {
  font-family: "Inter Tight Fallback";
  src: local("Helvetica Neue"), local("HelveticaNeue"), local("Arial"), local("ArialMT");
  size-adjust: 95%;
}

:root {
  --a-bg: #f3f3f1;
  --a-bg-hi: #fafaf9;
  --a-ink: #111111;
  --a-ink-2: #4b4b4b;
  --a-ink-3: #6b6b6b;                /* small print: 4.8:1 on --a-bg (AA needs 4.5) */
  --a-line: rgba(17, 17, 17, 0.16);
  --a-font: "Inter Tight", "Inter Tight Fallback", "Helvetica Neue", Helvetica, Arial, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html.is-locked { overflow: hidden; }
body { background: var(--a-bg); color: var(--a-ink); font-family: var(--a-font); }
button { -webkit-tap-highlight-color: transparent; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  /* Exactly one screen, never taller: a min-height pushed the buttons below
     the fold on landscape phones / 200% zoom. Short screens tighten the copy
     instead (see the landscape query at the end). */
  height: 100vh; height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(64% 58% at 50% 46%, var(--a-bg-hi) 0%, var(--a-bg) 62%, #ecece9 100%);
}

.ring { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; }

/* ---------- nav ---------- */
.nav {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: max(env(safe-area-inset-top), clamp(14px, 2.4vw, 28px)) clamp(18px, 4vw, 48px) 0;
}
/* The nav boxes stay text-sized: the ring steers its cards around exactly
   these boxes (main.js `avoid`), so padding them would push the back row down
   for nothing. An invisible ::before grows each tap target to 44px tall and
   7px wider per side instead (WCAG 2.5.5 / Apple HIG). */
/* Logo 49 lockup: pebble mark + the name, capitalised (owner's call
   2026-10-21), in the site face -- the logo's own lettering is lowercase-only.
   Same weight as the gallery's "Bevan Photography" back button. */
.brand {
  position: relative;
  display: flex; align-items: center; gap: 0.5em;
  font-family: var(--a-font); font-weight: 500; letter-spacing: -0.01em;
  font-size: clamp(1rem, 0.4vw + 0.85rem, 1.15rem); line-height: 1.15;
  color: var(--a-ink); text-decoration: none;
}
/* Optical centring: the big bottom pebble puts the mark's visual centre 5.83%
   of its height below its box centre (tools/gen_favicons.py prints it), so a
   box-centred mark reads as sitting low. The lift puts that centre on the
   cap-height middle (one line) / on the middle of cap top to "Sydney"'s
   baseline (phones) -- within 0.6px at 1440 / 1024 / 390 / 320. */
.brand-mark {
  flex: none; height: 1.5em; width: auto; aspect-ratio: 350.8 / 468.7; fill: currentColor;
  transform: translateY(-5.83%);
}
/* Where the work happens, in a quieter voice than the name itself. */
.brand-loc { color: var(--a-ink-2); font-weight: 400; }
/* The links never give up width: a squeezed nav breaks CJK labels mid-word
   (作品 / 集); the brand scales instead (see the 479px rule). */
.nav-links { display: flex; flex: none; gap: clamp(14px, 2vw, 30px); }
.nav-link {
  position: relative; appearance: none; background: none; border: 0; padding: 0; margin: 10px 0;
  font: inherit; font-size: 0.9rem; letter-spacing: 0.02em; color: var(--a-ink-2); cursor: pointer;
  white-space: nowrap;
}
.brand-text { white-space: nowrap; }
.brand::before, .nav-link::before {
  content: ""; position: absolute; left: -7px; right: -7px; top: 50%; height: 44px; margin-top: -22px;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease-out-soft);
}
a.nav-link { text-decoration: none; }          /* 联系 is a page, not an overlay: a link */
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--a-ink); }
.nav-link:hover::after, .nav-link:focus-visible::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link:focus-visible { outline: none; color: var(--a-ink); }
/* The current page's link is already dark and underlined: focus needs a ring. */
.nav-link[aria-current="page"]:focus-visible { outline: 2px solid var(--a-ink); outline-offset: 4px; border-radius: 2px; }

/* ---------- copy ---------- */
.stage {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  /* Bottom padding > top: the front row is the big one, so the copy sits a
     touch high and the whole composition centres in the viewport. */
  padding: clamp(64px, 9vh, 96px) clamp(20px, 5vw, 48px) clamp(96px, 16vh, 160px);
  pointer-events: none;
}
.copy {
  position: relative; isolation: isolate;
  max-width: 100%; text-align: center; pointer-events: auto;
  transition: opacity 0.6s ease 0.2s, transform 0.85s var(--ease-out-soft) 0.15s;
}
/* Soft light pool under the type, so a card drifting close can't fight it. */
.copy::before {
  content: ""; position: absolute; z-index: -1; inset: -14% -16%;
  background: radial-gradient(closest-side, var(--a-bg-hi) 35%, transparent 100%);
  opacity: 0.9; pointer-events: none;
}

.copy > * { animation: aRise 0.95s var(--ease-out-soft) both; }
.copy > :nth-child(1) { animation-delay: 0.15s; }
.copy > :nth-child(2) { animation-delay: 0.26s; }
.copy > :nth-child(3) { animation-delay: 0.38s; }
@keyframes aRise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(2.6rem, 6.2vw + 0.3rem, 7.2rem);
  line-height: 0.95; letter-spacing: -0.035em;
}
h1 span { display: block; }

.sub {
  margin: clamp(14px, 2.2vh, 24px) auto 0;
  font-size: clamp(0.98rem, 0.5vw + 0.72rem, 1.28rem);
  line-height: 1.45; letter-spacing: -0.005em; color: var(--a-ink-2);
}
.sub span { display: block; }

.cta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  margin-top: clamp(20px, 3.4vh, 36px);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.45em; border-radius: 6px; border: 1px solid transparent;
  font: inherit; font-size: 0.98rem; font-weight: 500; letter-spacing: 0.04em; line-height: 1.1;
  cursor: pointer; text-decoration: none;
  transition: transform 0.3s var(--ease-out-soft), background-color 0.3s ease, box-shadow 0.3s ease;
}
.btn-solid { background: var(--a-ink); color: #fff; box-shadow: 0 10px 24px -14px rgba(17, 17, 17, 0.6); }
.btn-solid:hover { background: #2a2a2a; transform: translateY(-1px); box-shadow: 0 16px 30px -16px rgba(17, 17, 17, 0.65); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.62); color: var(--a-ink); border-color: rgba(17, 17, 17, 0.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--a-ink); outline-offset: 3px; }

/* ---------- leaving for the gallery ---------- */
.nav { transition: opacity 0.6s ease 0.2s; }
.hero.is-leaving .copy { opacity: 0; transform: translateY(-14px) scale(0.985); transition: opacity 0.4s ease, transform 0.6s var(--ease-out-soft); pointer-events: none; }
.hero.is-leaving .nav { opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }

/* ---------- gallery ---------- */
.gallery {
  position: fixed; inset: 0; z-index: 50;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  background: radial-gradient(90% 50% at 50% 0%, var(--a-bg-hi) 0%, var(--a-bg) 70%);
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s var(--ease-out-soft), visibility 0s linear 0.5s;
}
.gallery.open { opacity: 1; visibility: visible; transition-delay: 0s; }

.g-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: max(env(safe-area-inset-top), clamp(14px, 2.2vw, 26px)) clamp(18px, 4vw, 48px) 14px;
  background: linear-gradient(180deg, var(--a-bg) 0%, color-mix(in srgb, var(--a-bg) 70%, transparent) 60%, transparent 100%);
}
.g-back, .g-book {
  appearance: none; border: 0; background: none; cursor: pointer; font: inherit; color: var(--a-ink);
}
.g-back { display: inline-flex; align-items: center; gap: 0.55rem; padding: 10px 0; font-size: clamp(1rem, 0.4vw + 0.85rem, 1.15rem); font-weight: 500; }
.g-back i { font-style: normal; transition: transform 0.3s var(--ease-out-soft); }
.g-back:hover i { transform: translateX(-4px); }
.g-book { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--a-line); font-size: 0.88rem; letter-spacing: 0.04em; background: rgba(255, 255, 255, 0.6); }
.g-book:hover { background: #fff; }
.g-back:focus-visible, .g-book:focus-visible { outline: 2px solid var(--a-ink); outline-offset: 3px; }

.g-inner { position: relative; padding: clamp(0.5rem, 2vw, 2rem) clamp(20px, 5vw, 72px) 5rem; }
.g-head { text-align: center; max-width: 44rem; margin: 0 auto clamp(2.4rem, 5vw, 4rem); }
.g-eyebrow { margin: 0; font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--a-ink-3); }
.g-head h2 {
  margin: 0.6rem 0 0.7rem; font-weight: 500; letter-spacing: -0.035em; line-height: 1;
  font-size: clamp(2.2rem, 4.8vw, 4.4rem);
}
/* :not() -- a bare `.g-head p` (0,1,1) would out-rank `.g-eyebrow` (0,1,0)
   and undo its small grey caps. */
.g-head p:not(.g-eyebrow) { margin: 0; font-size: clamp(0.95rem, 0.4vw + 0.8rem, 1.1rem); color: var(--a-ink-2); }
/* The approach: wall text under the title. Body size, not display size, in
   a narrow left-aligned column, so it reads as a caption to the wall and the
   first row of works still shows in the first screen. `.g-head .g-approach p`
   (0,2,1) comes after the rule above, so it wins at equal specificity. */
.g-approach { max-width: 31em; margin: clamp(1rem, 2vw, 1.4rem) auto 0; text-align: left; font-size: clamp(0.9rem, 0.15vw + 0.86rem, 0.98rem); }
.g-head .g-approach p { margin: 0; font-size: inherit; line-height: 1.8; color: var(--a-ink-2); text-wrap: pretty; }
.g-head .g-approach p + p { margin-top: 0.5em; }

/* The works themselves (exhibition wall, canvas, light): exhibit.css + frame.css. */

.g-end { margin: clamp(4rem, 8vw, 6rem) auto 0; text-align: center; }
.g-end p { margin: 0 0 1.1rem; font-size: 1rem; color: var(--a-ink-2); }

/* ---------- booking ---------- */
/* show(), not showModal() (booking.js): the dialog itself is the veil, above the gallery
   (z-index 50); reCAPTCHA's puzzle (on <body>, far higher z-index) still lands on top. */
.booking {
  position: fixed; inset: 0; z-index: 60;
  width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  margin: 0; padding: 0; border: 0; color: var(--a-ink);
  background: rgba(17, 17, 17, 0.36); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.booking[open] { display: flex; align-items: center; justify-content: center; animation: aVeil 0.3s ease both; }
@keyframes aVeil { from { opacity: 0; } to { opacity: 1; } }

.b-sheet {
  position: relative;
  width: min(520px, calc(100% - 32px)); max-height: calc(100svh - 32px); overflow-y: auto; overscroll-behavior: contain;
  padding: 30px 28px 24px; border-radius: 14px;
  background: #fbfbfa; box-shadow: 0 34px 80px -34px rgba(0, 0, 0, 0.45);
  animation: aSheet 0.42s var(--ease-out-soft) both;
}
@keyframes aSheet { from { opacity: 0; transform: translateY(16px) scale(0.985); } to { opacity: 1; transform: none; } }

.b-close {
  position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%;
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 1.6rem; line-height: 1; color: var(--a-ink-2);
}
.b-close:hover { background: rgba(17, 17, 17, 0.06); color: var(--a-ink); }
.b-close:focus-visible { outline: 2px solid var(--a-ink); outline-offset: 1px; }

.booking h2 { margin: 0; font-size: 1.6rem; font-weight: 500; letter-spacing: -0.02em; }
.b-lede { margin: 0.5rem 2.2rem 0.4rem 0; font-size: 0.95rem; line-height: 1.6; color: var(--a-ink-2); }

.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 0; min-width: 0; }
.field > span, .chips legend { font-size: 0.82rem; letter-spacing: 0.04em; color: var(--a-ink-2); }
.field em { font-style: normal; color: var(--a-ink-3); margin-left: 0.3em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--a-line); border-radius: 8px;
  background: #fff; color: var(--a-ink);
  font: inherit; font-size: 16px;      /* below 16px iOS zooms the page on focus */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
/* Native select/date chrome differs per engine (WebKit's select is ~27px tall,
   its date box 48px); flatten the select and give both the same 48px floor so
   the row lines up everywhere. */
.field select {
  -webkit-appearance: none; appearance: none; min-height: 48px; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234b4b4b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px;
  cursor: pointer;
}
.field input[type="date"] { min-height: 48px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--a-ink); box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08); }
.field [aria-invalid="true"] { border-color: #b0362b; box-shadow: 0 0 0 3px rgba(176, 54, 43, 0.12); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.chips { border: 0; padding: 0; flex-direction: row; flex-wrap: wrap; gap: 8px; }
.chips legend { padding: 0; margin-bottom: 8px; width: 100%; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--a-line);
  font-size: 0.92rem; cursor: pointer; background: #fff;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.chips input:checked + span { background: var(--a-ink); border-color: var(--a-ink); color: #fff; }
.chips input:focus-visible + span { outline: 2px solid var(--a-ink); outline-offset: 2px; }

.b-error { margin: 12px 0 0; font-size: 0.88rem; color: #b0362b; }
.b-trap { position: absolute; left: -10000px; top: 0; width: 1px; height: 1px; overflow: hidden; }
/* booking.js's two focus stops at the sheet's edges: focusable, never seen (focus moves straight on). */
.b-edge { position: absolute; width: 1px; height: 1px; overflow: hidden; outline: none; }
/* The robot check, right above the button (form-core.js fills it). Invisible
   reCAPTCHA has no box: only form-core's note line ever shows here. */
.b-captcha { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; margin-top: 12px; }
.b-submit { width: 100%; min-height: 50px; margin-top: 12px; }
.b-submit[aria-busy="true"] { cursor: progress; opacity: 0.72; }
.b-privacy { margin: 10px 0 0; font-size: 0.78rem; line-height: 1.6; color: var(--a-ink-3); }
.b-privacy a { color: var(--a-ink-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }   /* → terms.html */
.b-privacy a:focus-visible { outline: 2px solid var(--a-ink); outline-offset: 2px; border-radius: 2px; }
.b-fallback { margin-top: 14px; }

.b-done { padding: 18px 0 6px; text-align: center; }
.b-done p { margin: 0.8rem auto 1.4rem; max-width: 34ch; font-size: 0.95rem; line-height: 1.65; color: var(--a-ink-2); }
.b-done h2:focus { outline: none; }   /* focused by script only, to land the reader here */
.b-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.b-done.is-demo h2 { color: #b0362b; }

/* ---------- form core (form-core.js: the contact form and the booking dialog) ---------- */
.fc-widget { overflow: hidden; }
.fc-widget:empty { display: none; }
/* Invisible reCAPTCHA's floating badge: hidden, as Google allows, because the
   privacy line under each form names reCAPTCHA and links Google's policies. */
.grecaptcha-badge { visibility: hidden; }
.fc-note { margin: 0; max-width: 26em; font-size: 0.82rem; line-height: 1.55; color: var(--a-ink-2); }
.fc-note[hidden], .fc-fallback[hidden], .fc-fb-field[hidden] { display: none; }
.fc-fallback { padding: 14px 16px; border-radius: 8px; background: rgba(17, 17, 17, 0.045); }
.fc-fb-title { margin: 0 0 6px; font-size: 0.88rem; font-weight: 500; }
.fc-fb-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 0.92rem; }
.fc-fb-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.fc-fb-copy { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; cursor: pointer;
  border: 1px solid var(--a-line); border-radius: 6px; background: #fff; font: inherit; color: var(--a-ink); }
.fc-fb-tag, .fc-fb-note, .fc-fb-msg { font-size: 0.8rem; color: var(--a-ink-2); }
.fc-fb-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--a-ink); text-underline-offset: 3px; }
.fc-fb-field { width: 100%; padding: 8px 10px; border: 1px solid var(--a-line); border-radius: 6px; font: inherit; font-size: 16px; }
.fc-fb-copy:focus-visible, .fc-fb-link:focus-visible { outline: 2px solid var(--a-ink); outline-offset: 2px; border-radius: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 639px) {
  .nav-link { font-size: 0.86rem; }
  .stage { padding: 72px 20px 104px; }
  .cta { gap: 10px; }
  .btn { padding: 0 1.25em; font-size: 0.95rem; }

  .g-book { padding: 8px 13px; font-size: 0.82rem; }
  .g-back, .g-book { min-height: 44px; }     /* touch target */

  /* Phone: the dialog becomes a bottom sheet. */
  .booking[open] { align-items: flex-end; }
  .b-sheet {
    width: 100%; max-height: 92svh; border-radius: 18px 18px 0 0;
    padding: 26px 20px max(20px, env(safe-area-inset-bottom));
    animation-name: aSheetUp;
  }
  @keyframes aSheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}
/* Portrait phones: on one line "· Sydney" runs up against "作品集", so the
   place drops under the name and the mark spans both lines (like logo 49's
   stacked lockup). The lockup is ~10.7em wide, so below 375px it shrinks with
   the screen: at 320 it is ~150px, leaving the 16px nav gap free. */
@media (max-width: 479px) {
  .brand { font-size: min(1rem, 4.4vw); }
  .brand-loc { display: block; margin-top: 1px; font-size: 0.8em; }
  .brand-sep { display: none; }
  .brand-mark { height: 2.3em; }
}
/* Three nav links (作品集 / 预约拍摄 / 联系) need ~28px more than the lockup
   leaves below 390px (at 320 they ran 26px off the screen): 预约拍摄 says
   just 预约 there -- clear enough on a photographer's site. */
@media (max-width: 389px) {
  .nl-more { display: none; }
}
@media (max-width: 359px) {
  .nav-links { gap: 12px; }
  /* Buttons stay side by side (both fit in 280px): stacking made the copy so
     tall that the front row of cards covered "浏览作品集". The type steps down
     too: at full size the lines span ~80% of a 320px screen and no ring
     clears them, so the ring gives up and cards land on the copy and nav. */
  h1 { font-size: clamp(2rem, 11.5vw, 2.3rem); }
  .sub { font-size: 0.9rem; }
  .field-row { grid-template-columns: 1fr; }
}
/* Short landscape screens (phones on their side, desktop at 200% zoom): the
   hero is exactly one screen, so the copy shrinks to keep the buttons in view
   and clear of the nav. */
@media (orientation: landscape) and (max-height: 500px) {
  .stage { padding-top: 48px; padding-bottom: 56px; }
  h1 { font-size: clamp(2rem, 11vh, 3.4rem); }
  .sub { margin-top: 8px; font-size: 0.92rem; }
  .cta { margin-top: 14px; }
}
