/* The photographs use the proportions of the iPhone 17 display. */
:root { --vault-green: #174a38; --paper: #f9f9f4; }
.cv-hero {
  max-width: 1120px; box-sizing: border-box; margin: 0 auto;
  padding: 32px clamp(20px, 5vw, 40px) 48px;
  display: grid; grid-template-columns: minmax(0,.97fr) minmax(0,1.03fr);
  align-items: center; gap: clamp(30px,5vw,76px);
}
.cv-hero-copy { display: grid; justify-items: start; align-content: center; gap: 22px; }
.cv-hero h1 { width: 100%; margin: 0; font-size: clamp(41px,4.3vw,66px); line-height: 1.04; letter-spacing: -.055em; text-wrap: balance; }
.cv-hero h1 em { display: block; font-family: Baskerville, Georgia, "Songti TC", "Songti SC", serif; color: var(--vault-green); font-weight: 500; font-style: italic; letter-spacing: -.045em; }
:lang(zh) .cv-hero h1 { font-size: clamp(39px,3.35vw,52px); letter-spacing: -.035em; line-height: 1.2; }
:lang(zh) .cv-hero h1 em { font-style: normal; }
.cv-art {
  display: block; position: relative; isolation: isolate; overflow: hidden; margin: 0;
  aspect-ratio: 1.07; border-radius: 28px; background-color: #154538;
  background-image: radial-gradient(ellipse at 25% 10%,#76a784 0%,#407c61 32%,transparent 65%),
    linear-gradient(122deg,#487a58 0%,#194b3b 51%,#102d26 100%);
}
.cv-art::before, .cv-stage::before {
  content: ""; position: absolute; inset: -40%; pointer-events: none;
  background: repeating-radial-gradient(ellipse at 78% 82%,transparent 0 18px,rgba(240,255,213,.14) 18.5px 19px,transparent 19.5px 26px);
  transform: rotate(-24deg);
}
.cv-device { box-sizing: border-box; background: #171e1b; border: 2px solid #515751; border-radius: 15.8% / 7.45%; padding: 1.1%; overflow: hidden; box-shadow: 2px 2px 0 #809184, 8px 15px 22px #102a2660, 16px 32px 48px #102b2652; }
.cv-device img { display: block; width: 100%; height: auto; border-radius: 13.4% / 6.25%; }
.cv-art .cv-device { position: absolute; width: 48%; }
.cv-art .cv-back { top: 17%; left: 4%; transform: rotate(-12deg); }
.cv-art .cv-front { top: 11%; left: 46%; transform: rotate(9deg); }
.cv-gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(14px,2.1vw,25px); }
.cv-card { min-width: 0; text-decoration: none; color: var(--ink); display: block; }
.cv-card:focus-visible,.cv-art:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; border-radius: 20px; }
.cv-stage { isolation: isolate; position: relative; overflow: hidden; aspect-ratio: 1.12; border-radius: 19px; background: var(--stage); }
.cv-card:nth-child(1) { --stage: #d9e8d9; --edge: #67937f; }
.cv-card:nth-child(2) { --stage: #e9dfca; --edge: #ad9263; }
.cv-card:nth-child(3) { --stage: #e4e0ed; --edge: #9990b0; }
.cv-stage::before { opacity: .44; inset: -24%; background: repeating-radial-gradient(ellipse at 0 100%,transparent 0 18px,var(--edge) 18.5px 19px,transparent 19.5px 29px); }
.cv-stage .cv-device { position: absolute; width: 69%; top: 10%; left: 15.5%; padding: 1.15%; box-shadow: 1px 1px 0 #82877b, 4px 10px 22px #28383035; transition: transform .24s ease; }
.cv-card:hover .cv-device, .cv-card:focus-visible .cv-device { transform: translateY(-5px); }
.cv-expand { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; display: grid; place-items: center; background: #ffffffec; color: #254838; border-radius: 50%; box-shadow: 0 1px 4px #20312816; }
.cv-expand svg, .cv-tool svg { width: 18px; height: 18px; }
.cv-card h3 { margin: 17px 0 5px; font-size: 21px; line-height: 1.22; letter-spacing: -.025em; color: var(--ink); }
.cv-card p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.cv-dialog { max-width: none; max-height: none; width: min(900px,calc(100% - 32px)); height: min(920px,calc(100% - 28px)); height: min(920px,calc(100dvh - 28px)); margin: auto; padding: 0; border: 0; border-radius: 22px; background: #f2f3ed; color: var(--ink); box-sizing: border-box; }
.cv-dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.cv-dialog::backdrop { background: #0f211de8; }
html:has(.cv-dialog[open]) { overflow: hidden; }
.cv-dialog header, .cv-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.cv-dialog h2 { font-size: 18px; line-height: 1.3; margin: 0; }
.cv-tool { cursor: pointer; display: inline-grid; place-items: center; width: 44px; height: 44px; background: #fff; border: 1px solid #b6c4b8; color: var(--vault-green); border-radius: 50%; }
.cv-tool:hover { background: #e2ece4; }
.cv-tool:focus-visible, .cv-dialog-image:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.cv-view { overflow: auto; text-align: center; background: #dfe5dc; padding: 8px; }
.cv-dialog-image { display: block; margin: auto; height: 100%; width: fit-content; max-width: 100%; border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.cv-dialog-image img { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.cv-view.enlarged .cv-dialog-image { width: min(650px,100%); height: auto; cursor: zoom-out; }
.cv-view.enlarged img { width: 100%; height: auto; }
.cv-dialog footer span { font: 14px var(--font-mono); color: var(--ink-2); }
@media (max-width: 800px) {
  .cv-hero { grid-template-columns: 1fr; gap: 27px; padding-block: 26px 36px; }
  body > div > header { display: grid !important; grid-template-columns: 1fr auto; gap: 7px 12px !important; }
  body > div > header > div { display: contents !important; }
  body > div > header nav { grid-row: 2; grid-column: 1 / -1; gap: 0 16px !important; }
  body > div > header .lang { grid-row: 1; grid-column: 2; justify-self: end; }
  .cv-hero { gap: 18px; }
  .cv-hero-copy { display: contents; }
  .cv-hero-copy > div:first-child { order: 0; justify-self: start; }
  .cv-hero h1 { order: 1; }
  .cv-art { order: 2; }
  .cv-hero-copy > p { order: 3; }
  .cv-hero-copy > div:not(:first-child) { order: 4; }
  .cv-hero-copy > p:last-child { order: 5; }
  .cv-hero h1 { font-size: clamp(39px,7.8vw,56px); }
  :lang(zh) .cv-hero h1 { font-size: clamp(31px,8.1vw,47px); }
  .cv-art { aspect-ratio: 1.44; max-height: 410px; }
  .cv-art .cv-device { width: 40%; }
  .cv-art .cv-back { left: 11%; top: 15%; }
  .cv-art .cv-front { left: 48%; top: 9%; }
  .cv-gallery { grid-template-columns: 1fr; gap: 24px; }
  .cv-card { display: grid; grid-template-columns: minmax(106px,.85fr) minmax(0,1fr); align-items: center; gap: 16px; }
  .cv-card h3 { margin-top: 0; }
  .cv-stage { aspect-ratio: .98; }
  .cv-stage .cv-device { width: 76%; left: 12%; }
  .cv-expand { width: 27px; height: 27px; top: 6px; right: 6px; }
}
@media (max-width: 420px) {
  .cv-dialog { width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
  .cv-dialog header { padding-top: max(8px,env(safe-area-inset-top)); }
  .cv-dialog footer { padding-bottom: max(10px,env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .cv-stage .cv-device { transition: none; } }
