@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Jost:wght@300;400;500&family=DM+Sans:wght@400;500&family=Noto+Sans+SC:wght@300;400;500&display=swap");

/* AME Visual Studio — component styles. Every colour, size and gap comes from tokens.css. */

.ame { font-family: var(--font-sans); color: var(--ink); }
.ame-cjk { font-family: var(--font-cjk); }

/* Eyebrow: uppercase tracked label */
.ame-eyebrow { margin: 0; font-family: var(--font-sans); font-size: 12px; line-height: 16px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-subtle); }

/* Logo: shows the Paper logo in Midnight and the Ink logo in Paper. Force one with a modifier. */
.ame-logo { display: inline-block; line-height: 0; }
.ame-logo img { display: block; width: 100%; height: auto; }
.ame-logo__ink { display: none !important; }
[data-theme="paper"] .ame-logo:not(.ame-logo--paper) .ame-logo__paper { display: none !important; }
[data-theme="paper"] .ame-logo:not(.ame-logo--paper) .ame-logo__ink { display: block !important; }
.ame-logo--ink .ame-logo__paper { display: none !important; }
.ame-logo--ink .ame-logo__ink { display: block !important; }

/* Signature: the handwritten script. Paper version in Midnight, Ink version in Paper. */
.ame-signature { display: inline-block; line-height: 0; }
.ame-signature img { display: block; width: 100%; height: auto; }
.ame-signature__ink { display: none !important; }
[data-theme="paper"] .ame-signature:not(.ame-signature--paper) .ame-signature__paper { display: none !important; }
[data-theme="paper"] .ame-signature:not(.ame-signature--paper) .ame-signature__ink { display: block !important; }
.ame-signature--ink .ame-signature__paper { display: none !important; }
.ame-signature--ink .ame-signature__ink { display: block !important; }

/* Fold: the signature folded-paper panel. Place inside a position:relative parent. */
.ame-fold { position: absolute; top: 0; right: 0; bottom: 0; width: var(--ame-fold-w, 40%); pointer-events: none; }
.ame-fold > i { position: absolute; inset: 0; display: block; }
.ame-fold__base { background: var(--fold-1); clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%); }
.ame-fold__flap { background: var(--fold-2); clip-path: polygon(30% 0, 100% 0, 100% 55%); }
.ame-fold__crease { background: var(--fold-crease); clip-path: polygon(100% 55%, 100% 57.5%, 0 100%, 0 100%); }
.ame-fold__foot { background: var(--fold-3); clip-path: polygon(0 100%, 100% 57.5%, 100% 100%); }
.ame-fold--corner { top: 0; right: 0; bottom: auto; width: var(--ame-fold-w, 140px); height: var(--ame-fold-w, 140px); }
.ame-fold--corner .ame-fold__base { background: var(--brand-midnight); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.ame-fold--corner .ame-fold__flap { background: var(--brand-silver); clip-path: polygon(0 0, 100% 100%, 0 100%); }

/* Button: sharp, uppercase, tracked */
.ame-button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 var(--space-4); border: 1px solid var(--ink); border-radius: var(--radius-none); background: var(--ink); color: var(--surface); font-family: var(--font-sans); font-size: 13px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background .2s ease, color .2s ease; }
.ame-button:hover { background: transparent; color: var(--ink); }
.ame-button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.ame-button--ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.ame-button--ghost:hover { border-color: var(--ink); }
.ame-button__cjk { font-family: var(--font-cjk); font-weight: 300; letter-spacing: 0.3em; }

/* Title slide: 16:9 */
.ame-slide { position: relative; width: 100%; aspect-ratio: 16 / 9; max-width: 100%; background: var(--surface); color: var(--ink); overflow: hidden; container-type: inline-size; }
.ame-slide__body { position: absolute; left: 6.7cqw; top: 6.7cqw; bottom: 6.7cqw; width: 52cqw; display: flex; flex-direction: column; justify-content: space-between; }
.ame-slide__logo { width: 17.7cqw; }
.ame-slide__title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 6cqw; line-height: 1.05; letter-spacing: 0.2em; text-transform: uppercase; }
.ame-slide__cjk { margin: 2cqw 0 0; font-family: var(--font-cjk); font-weight: 300; font-size: 1.9cqw; letter-spacing: 0.5em; color: var(--ink-muted); }
.ame-slide__meta { margin: 0; font-size: 1.2cqw; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-subtle); }
.ame-slide .ame-fold { --ame-fold-w: 43%; }

/* Invoice / document sheet: always light */
.ame-sheet { position: relative; background: var(--surface-sheet); color: var(--ink-on-sheet); padding: var(--space-6) var(--space-7); display: flex; flex-direction: column; gap: var(--space-5); overflow: hidden; font-family: var(--font-sans); }
.ame-sheet__head { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.ame-sheet__divider { width: 1px; height: 72px; background: var(--brand-silver); }
.ame-sheet__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 44px; line-height: 1; letter-spacing: 0.24em; }
.ame-sheet__sub { margin: var(--space-2) 0 0; font-family: var(--font-cjk); font-weight: 300; font-size: 14px; letter-spacing: 0.3em; color: var(--ink-on-sheet-muted); }
.ame-sheet__parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); border-top: 1px solid var(--brand-silver); padding-top: var(--space-4); font-size: 14px; line-height: 1.7; }
.ame-sheet__label { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-on-sheet-muted); }
.ame-sheet__party { margin: 0; }
.ame-lines { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.ame-lines th { background: var(--brand-midnight); color: var(--brand-paper); font-weight: 400; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; text-align: left; padding: 12px var(--space-3); }
.ame-lines td { padding: 14px var(--space-3); border-bottom: 1px solid var(--brand-silver); }
.ame-lines .is-num { text-align: right; }

/* Business card: 90 × 54 mm */
.ame-card { position: relative; width: 100%; max-width: 548px; aspect-ratio: 90 / 54; background: var(--surface); color: var(--ink); overflow: hidden; container-type: inline-size; }
.ame-card--lift { box-shadow: var(--shadow-lift); }
.ame-card--front .ame-fold { --ame-fold-w: 40%; }
.ame-card--back .ame-fold { --ame-fold-w: 17.5%; }
.ame-card__logo { position: absolute; left: 9.5cqw; top: 50%; transform: translateY(-50%); width: 39.4cqw; }
.ame-card__info { position: absolute; inset: 0; padding: 8cqw 8.8cqw; display: flex; flex-direction: column; justify-content: space-between; }
.ame-card__name { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 5.8cqw; letter-spacing: 0.2em; text-transform: uppercase; }
.ame-card__role { margin: 1.5cqw 0 0; font-size: 2.2cqw; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-muted); }
.ame-card__role-cjk { margin: 0.7cqw 0 0; font-family: var(--font-cjk); font-weight: 300; font-size: 2.2cqw; letter-spacing: 0.4em; color: var(--ink-muted); }
.ame-card__contact { display: flex; flex-direction: column; gap: 0.9cqw; font-size: 2.4cqw; letter-spacing: 0.06em; }

/* ───────── Web & portfolio components ───────── */

/* Icons: 24px grid, 1.5 stroke, square caps, currentColor */
.ame-icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.ame-icon--lg { width: 32px; height: 32px; }

/* Bilingual text */
.ame-bi { display: flex; flex-direction: column; gap: var(--space-2); }
.ame-bi__en { margin: 0; font-family: var(--font-display); font-weight: 500; text-transform: uppercase; color: inherit; text-wrap: balance; }
.ame-bi__zh { margin: 0; font-family: var(--font-cjk); font-weight: 300; color: var(--ink-muted); }
.ame-bi--section .ame-bi__en { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: 0.16em; }
.ame-bi--section .ame-bi__zh { font-size: 18px; letter-spacing: 0.4em; }
.ame-bi--card .ame-bi__en { font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: 0.16em; }
.ame-bi--card .ame-bi__zh { font-size: 16px; font-weight: 400; letter-spacing: 0.3em; }
.ame-bi-label { font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-subtle); }
.ame-bi-label span { font-family: var(--font-cjk); letter-spacing: 0.3em; text-transform: none; }
.ame-lead { margin: 0; max-width: 60ch; font-size: 18px; line-height: 1.65; font-weight: 300; color: var(--ink); }
.ame-lead-zh { margin: 0; max-width: 36em; font-family: var(--font-cjk); font-size: 15px; line-height: 1.9; font-weight: 300; letter-spacing: 0.04em; color: var(--ink-muted); }
.ame-section-head { display: flex; flex-direction: column; gap: var(--space-3); }

/* Tag: small outlined label (Coming soon, 16:9, Website) */
.ame-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--hairline); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-muted); width: fit-content; }
.ame-tag span { font-family: var(--font-cjk); letter-spacing: 0.2em; text-transform: none; }

/* Portfolio card */
.ame-work { display: flex; flex-direction: column; gap: var(--space-3); color: var(--ink); text-decoration: none; min-width: 0; }
.ame-work__media { position: relative; aspect-ratio: 16 / 9; background: var(--media-ground); overflow: hidden; }
.ame-work--vertical .ame-work__media { aspect-ratio: 9 / 16; }
.ame-work__media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.ame-work:hover .ame-work__media > img { transform: scale(1.03); }
.ame-work__marks { position: absolute; inset: 12px; pointer-events: none; }
.ame-work__marks::before, .ame-work__marks::after { content: ""; position: absolute; width: 14px; height: 14px; border: 0 solid var(--media-ink); opacity: .7; }
.ame-work__marks::before { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.ame-work__marks::after { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }
.ame-work__play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); border: 1px solid var(--media-ink); border-radius: var(--radius-round); color: var(--media-ink); display: grid; place-items: center; transition: background .2s ease, color .2s ease; }
.ame-work__play::before { content: ""; width: 16px; height: 18px; margin-left: 4px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.ame-work:hover .ame-work__play, .ame-work:focus-visible .ame-work__play { background: var(--media-ink); color: var(--media-ground); }
.ame-work--vertical .ame-work__play { width: 52px; height: 52px; }
.ame-work__time { position: absolute; right: 14px; bottom: 12px; font-size: 11px; letter-spacing: 0.16em; color: var(--media-ink); font-variant-numeric: tabular-nums; }
.ame-work__ratio { position: absolute; left: 14px; bottom: 12px; font-size: 11px; letter-spacing: 0.16em; color: var(--media-ink); }
.ame-work__body { display: flex; flex-direction: column; gap: 6px; }
.ame-work__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; letter-spacing: 0.08em; color: var(--ink-subtle); }
.ame-work:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* Website variant: device stage */
.ame-work--web .ame-work__media { background: var(--surface-deep); border: 1px solid var(--hairline); box-sizing: border-box; }
.ame-laptop { position: absolute; left: 9%; bottom: 10%; width: 70%; }
.ame-laptop__lid { background: var(--device-frame); border-radius: var(--radius-device) var(--radius-device) 0 0; padding: 2.4% 2.4% 2%; }
.ame-laptop__screen { position: relative; aspect-ratio: 16 / 10; background: var(--media-ground); overflow: hidden; }
.ame-laptop__base { height: 9px; margin: 0 -6%; background: var(--device-frame); border-radius: 0 0 calc(var(--radius-device) / 2) calc(var(--radius-device) / 2); }
.ame-phone { position: absolute; right: 9%; bottom: 10%; width: 17%; background: var(--device-frame); border-radius: var(--radius-device); padding: 1.1%; box-sizing: border-box; outline: 3px solid var(--surface-deep); }
.ame-phone__screen { position: relative; aspect-ratio: 9 / 19.5; background: var(--media-ground); border-radius: calc(var(--radius-device) - 5px); overflow: hidden; }
.ame-laptop__screen > img, .ame-phone__screen > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ame-work--web.ame-work--vertical .ame-phone { left: 50%; right: auto; bottom: 8%; width: 58%; transform: translateX(-50%); }
.ame-work__live { position: absolute; right: 14px; top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-muted); }
.ame-work__live .ame-icon { width: 14px; height: 14px; }

/* Pricing */
.ame-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); align-items: stretch; }
.ame-price { position: relative; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6) var(--space-5) var(--space-5); border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); overflow: hidden; }
.ame-price--featured { background: var(--inverse-surface); color: var(--inverse-ink); border-color: var(--inverse-surface); }
.ame-price--featured .ame-bi__zh, .ame-price--featured .ame-price__note, .ame-price--featured .ame-price__unit, .ame-price--featured .ame-price__flag { color: var(--inverse-muted); }
.ame-price--featured .ame-price__list { border-top-color: var(--inverse-muted); }
.ame-price .ame-fold--corner { --ame-fold-w: 72px; }
.ame-price .ame-fold--corner .ame-fold__base { background: var(--inverse-ink); }
.ame-price__flag { margin: 0; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-subtle); min-height: 16px; }
.ame-price__flag span { font-family: var(--font-cjk); letter-spacing: 0.3em; }
.ame-price__amount { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-family: var(--font-display); font-size: 44px; line-height: 1; font-weight: 500; letter-spacing: 0.02em; font-variant-numeric: tabular-nums lining-nums; }
.ame-price__unit { font-family: var(--font-sans); font-size: 13px; letter-spacing: 0.08em; color: var(--ink-subtle); }
.ame-price__note { margin: 0; font-size: 13px; color: var(--ink-muted); }
.ame-price__list { list-style: none; margin: 0; padding: var(--space-4) 0 0; border-top: 1px solid var(--hairline); display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; flex: 1; }
.ame-price__list li { display: flex; gap: 10px; align-items: flex-start; }
.ame-price__list .ame-icon { width: 18px; height: 18px; margin-top: 1px; }
.ame-price__list .zh { font-family: var(--font-cjk); font-weight: 300; }
.ame-price .ame-button { width: 100%; }
.ame-price--featured .ame-button { background: var(--inverse-ink); color: var(--inverse-surface); border-color: var(--inverse-ink); }
.ame-price--featured .ame-button:hover { background: transparent; color: var(--inverse-ink); }
.ame-price--featured .ame-button:focus-visible { outline-color: var(--inverse-ink); }

/* Service card */
.ame-services { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-6) var(--space-5); }
.ame-service { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--hairline); color: var(--ink); }
.ame-service__body { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink-muted); }
.ame-service__body-zh { margin: 0; font-family: var(--font-cjk); font-size: 13px; line-height: 1.8; font-weight: 300; color: var(--ink-muted); }
.ame-service__link { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hairline); padding-bottom: 4px; width: fit-content; }
.ame-service__link:hover { border-bottom-color: var(--ink); }
.ame-service__link .ame-icon { width: 14px; height: 14px; }

/* Process steps */
.ame-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-5); counter-reset: none; }
.ame-step { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--hairline); }
.ame-step__num { margin: 0; font-family: var(--font-display); font-size: 48px; line-height: 1; font-weight: 500; color: var(--ink-subtle); font-variant-numeric: lining-nums; }
.ame-step--current { border-top: 2px solid var(--ink); }
.ame-step--current .ame-step__num { color: var(--ink); }
.ame-step__text { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink-muted); }
.ame-step__text-zh { margin: 0; font-family: var(--font-cjk); font-size: 13px; line-height: 1.8; font-weight: 300; color: var(--ink-muted); }

/* WhatsApp button + contact block */
.ame-whatsapp { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 var(--space-4) 0 var(--space-3); background: var(--ink); color: var(--surface); border: 1px solid var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; transition: background .2s ease, color .2s ease; }
.ame-whatsapp:hover { background: transparent; color: var(--ink); }
.ame-whatsapp:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.ame-whatsapp__num { font-weight: 400; letter-spacing: 0.06em; text-transform: none; opacity: .85; }
.ame-whatsapp--ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.ame-contact { display: flex; flex-direction: column; gap: var(--space-5); }
.ame-contact__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ame-contact__row { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-3); align-items: start; padding: var(--space-3) 0; border-bottom: 1px solid var(--hairline); }
.ame-contact__row:first-child { border-top: 1px solid var(--hairline); }
.ame-contact__value { margin: 4px 0 0; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.ame-contact__value a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--hairline); }
.ame-contact__value a:hover { border-bottom-color: var(--ink); }

/* Inquiry form */
.ame-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-4); }
.ame-form > .is-wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .ame-form { grid-template-columns: minmax(0, 1fr); } }
.ame-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; border: 0; margin: 0; padding: 0; }
.ame-field__label { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-muted); }
.ame-field__label span { font-family: var(--font-cjk); letter-spacing: 0.2em; text-transform: none; }
.ame-input { box-sizing: border-box; width: 100%; min-height: 48px; padding: 12px 14px; background: transparent; color: var(--ink); border: 1px solid var(--hairline); border-radius: var(--radius-xs); font: 400 15px/1.5 var(--font-sans); transition: border-color .2s ease; appearance: none; }
.ame-input::placeholder { color: var(--ink-subtle); }
.ame-input:hover { border-color: var(--ink-subtle); }
.ame-input:focus { outline: 2px solid var(--ink); outline-offset: 2px; border-color: var(--ink); }
textarea.ame-input { min-height: 120px; resize: vertical; }
.ame-select { position: relative; }
.ame-select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-muted); border-bottom: 1.5px solid var(--ink-muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.ame-select .ame-input { padding-right: 40px; cursor: pointer; }
.ame-select option { background: var(--surface); color: var(--ink); }
.ame-field__hint { margin: 0; font-size: 12px; color: var(--ink-subtle); }
.ame-field__error { margin: 0; font-size: 12px; color: var(--danger); }
.ame-field.is-invalid .ame-input { border-color: var(--danger); }
.ame-choices { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ame-choice { position: relative; }
.ame-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ame-choice span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-3); border: 1px solid var(--hairline); font-size: 13px; letter-spacing: 0.06em; color: var(--ink); transition: background .2s ease, color .2s ease; }
.ame-choice span b { font-family: var(--font-cjk); font-weight: 300; margin-left: 8px; }
.ame-choice input:checked + span { background: var(--inverse-surface); color: var(--inverse-ink); border-color: var(--inverse-surface); }
.ame-choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.ame-form__submit { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
