/* Opus Aureum Limited: page layer. Tokens only; palette lives in theme.css. */

/* ── Fonts (self-hosted, OFL; Latin and Cyrillic subsets) ── */
@font-face { font-family: Cormorant; font-style: normal; font-weight: 300 700; font-display: swap; src: url(fonts/cormorant-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Cormorant; font-style: italic; font-weight: 300 700; font-display: swap; src: url(fonts/cormorant-latin-wght-italic.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Cormorant; font-style: normal; font-weight: 300 700; font-display: swap; src: url(fonts/cormorant-cyrillic-wght-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: Cormorant; font-style: italic; font-weight: 300 700; font-display: swap; src: url(fonts/cormorant-cyrillic-wght-italic.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: Onest; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/onest-latin.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: Onest; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/onest-cyrillic.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }

:root {
  --shell: min(1400px, calc(100% - 40px));
  --section-pad: clamp(96px, 6vw + 56px, 176px);
  --header-height: 68px;
  --gold-col: 61.8%;
}
@media (min-width: 760px) { :root { --shell: min(1400px, calc(100% - 96px)); --header-height: 84px; } }

html { scroll-behavior: smooth; }
body { font-size: 1.0625rem; }
::selection { background: var(--accent-fill); color: var(--accent-on-fill); }

/* paper grain: a fixed screen-only layer, never on scrolling content */
@media screen {
  body::after {
    content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}

/* ── Header: edge to edge, transparent over the hero, vellum glass after scroll ── */
.site-header { position: sticky; top: 0; }
.site-header.is-scrolled { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); }
.header-inner { gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; margin-right: auto; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1.375rem; letter-spacing: 0; line-height: 1; }
.brand-mark { width: 34px; height: auto; flex: none; fill: none; stroke: var(--accent); stroke-width: 70; stroke-linecap: round; }
.brand-mark .brand-spiral { stroke-width: 90; }
.brand-suffix { font-family: var(--font-body); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); transform: translateY(1px); }
.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
@media (max-width: 559px) {
  .brand { display: grid; grid-template-columns: auto auto; column-gap: 10px; row-gap: 3px; align-items: center; font-size: 1.1875rem; }
  .brand-mark { grid-row: 1 / span 2; width: 30px; }
  .brand-suffix { font-size: 0.5625rem; letter-spacing: 0.34em; transform: none; }
  .header-link { padding-inline: 6px; font-size: 0.8125rem; letter-spacing: 0.06em; }
}
.header-link { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding-inline: 8px; font-size: 0.875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }
.header-link span { background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat; transition: background-size 500ms var(--ease-out); padding-block: 2px; }
.header-link:hover span { background-size: 100% 1px; }
.header-link svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 500ms var(--ease-out); }
.header-link:hover svg { transform: translateX(3px); }
.theme-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; cursor: pointer; transition: border-color 300ms var(--ease-out), transform 300ms var(--ease-out); }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; overflow: visible; }
.theme-toggle .tt-sun, .theme-toggle .tt-rays { transition: opacity 400ms var(--ease-out), transform 600ms var(--ease-out); transform-origin: 12px 12px; }
.theme-toggle .tt-moon { opacity: 0; transform: rotate(-40deg) scale(0.6); transform-origin: 12px 12px; transition: opacity 400ms var(--ease-out), transform 600ms var(--ease-out); }
.is-dark .theme-toggle .tt-sun, .is-dark .theme-toggle .tt-rays { opacity: 0; transform: rotate(60deg) scale(0.5); }
.is-dark .theme-toggle .tt-moon { opacity: 1; transform: none; }

/* scroll progress: a gold hairline under the header (scroll-driven, no script) */
@supports (animation-timeline: scroll()) {
  @media screen and (prefers-reduced-motion: no-preference) {
    .site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); animation: progress linear both; animation-timeline: scroll(root); }
  }
}
@keyframes progress { to { transform: scaleX(1); } }

/* ── Hero: edge to edge, a golden-section construction drawn in gold ── */
.hero { min-height: calc(100svh - var(--header-height)); align-content: end; padding-block: clamp(40px, 8vw, 96px) clamp(40px, 6vw, 88px); isolation: isolate; border-bottom: 1px solid var(--line); }
.hero-rules { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.hero-rules span { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.hero-rules span:first-child { left: 38.2%; }
.hero-rules span:last-child { left: 61.8%; }

.hero-art-wrap { position: absolute; z-index: -1; pointer-events: none; top: 4%; left: 8px; width: 118%; transform: translate3d(var(--ax, 0px), var(--ay, 0px), 0); will-change: transform; }
.hero-art { width: 100%; height: auto; overflow: visible; fill: none; stroke: var(--art-line); stroke-linecap: round; }
.hero-art .g-ticks { stroke-width: 3.2; opacity: 0.7; }
.hero-art .g-diag { stroke-width: 2.6; stroke-dasharray: 10 16; opacity: 0.55; }
.hero-art .g-orbits { stroke-width: 2.6; opacity: 0.45; }
.hero-art .g-frame, .hero-art .g-grid { stroke-width: 3.6; }
.hero-art .g-spiral { stroke: var(--accent); stroke-width: 7; }
.hero-art .g-pole circle { stroke: var(--accent); stroke-width: 3.6; }
.hero-art .g-pole .g-pole-dot { fill: var(--accent); stroke: none; }
@media (min-width: 760px) {
  .hero-art-wrap { top: 50%; left: auto; right: -9vw; width: min(78vw, 1240px); margin-top: calc(min(78vw, 1240px) * -0.318); }
  .hero-art .g-ticks, .hero-art .g-frame, .hero-art .g-grid, .hero-art .g-pole circle { stroke-width: 1.5; }
  .hero-art .g-orbits, .hero-art .g-diag { stroke-width: 1.1; stroke-dasharray: 6 10; }
  .hero-art .g-orbits { stroke-dasharray: none; }
  .hero-art .g-spiral { stroke-width: 3; }
}

.hero-inner { gap: clamp(28px, 4vw, 48px); }
@media (min-width: 900px) { .hero-inner { grid-template-columns: minmax(0, 1.618fr) minmax(0, 1fr); align-items: end; } }

.title { font-family: var(--font-display); font-weight: 500; line-height: var(--lh-display); letter-spacing: var(--tr-display); color: var(--ink); }
.title .line { display: block; overflow: clip; padding-block: 0.04em 0.12em; margin-block: -0.04em -0.12em; }
.title .line > span { display: inline-block; }
.line-1, .line-2 { font-size: clamp(5.25rem, 1.5rem + 18vw, 14.5rem); }
.line-2 { padding-left: 0.42em !important; }
.aureum { font-style: italic; font-weight: 400; color: var(--accent-text); padding-right: 0.08em; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .title .aureum {
    background-image: linear-gradient(105deg, var(--accent-text) 0 42%, var(--leaf-hi) 50%, var(--accent-text) 58% 100%);
    background-size: 300% 100%; background-position: 100% 0;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  }
}
.line-3 { margin-top: clamp(18px, 2.4vw, 32px) !important; font-family: var(--font-body); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.42em; text-transform: uppercase; color: var(--muted-strong); }
.line-3 > span { display: inline-flex !important; align-items: center; gap: 18px; }
.line-3 > span::before { content: ""; width: clamp(48px, 6vw, 96px); height: 1px; background: var(--accent); }

.hero-lead { text-shadow: 0 0 6px var(--bg), 0 0 18px var(--bg), 0 0 32px var(--bg); max-width: 22ch; font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: clamp(1.625rem, 1.2rem + 1.5vw, 2.5rem); line-height: 1.15; color: var(--ink); text-wrap: balance; }
@media (min-width: 900px) { .hero-lead { padding-top: 28px; border-top: 1px solid var(--line-strong); margin-bottom: 0.45em; } }

/* load sequence: once, screen only, skipped under reduced motion */
@media screen and (prefers-reduced-motion: no-preference) {
  .title .line > span { animation: rise 1300ms var(--ease-out) both; }
  .line-1 > span { animation-delay: 120ms; }
  .line-2 > span { animation-delay: 260ms; }
  .line-3 > span { animation-delay: 520ms; }
  .title .aureum { animation: rise 1300ms var(--ease-out) 260ms both, sheen 2200ms var(--ease-draw) 1500ms both; }
  .hero-lead { animation: fade-up 1100ms var(--ease-out) 700ms both; }
  .hero-rules span { animation: grow-y 1600ms var(--ease-draw) 100ms both; transform-origin: 50% 0; }
  .hero-art .g-draw { stroke-dasharray: 1; animation: draw 2600ms var(--ease-draw) both; }
  .hero-art .g-frame { animation-delay: 150ms; }
  .hero-art .g-grid { animation-delay: 650ms; animation-duration: 2200ms; }
  .hero-art .g-spiral { animation-delay: 1000ms; animation-duration: 3000ms; }
  .hero-art .g-ticks, .hero-art .g-diag, .hero-art .g-orbits { animation: fade 1800ms var(--ease-out) 1400ms both; }
  .hero-art .g-pole { animation: pop 900ms var(--ease-out) 3600ms both; transform-box: fill-box; transform-origin: center; }
  .site-header { animation: fade 900ms var(--ease-out) 200ms both; }
}
@keyframes rise { from { transform: translateY(108%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.2); } to { opacity: 1; transform: none; } }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ── Intro: a golden split, heading on the long side ── */
.intro-grid { display: grid; gap: clamp(28px, 4vw, 56px); }
.intro-sec .h2 { font-size: clamp(2.75rem, 1.4rem + 5vw, 6.25rem); line-height: 0.98; font-weight: 500; max-width: 12ch; }
.intro-copy { max-width: 34ch; font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3125rem); line-height: 1.6; color: var(--muted-strong); padding-top: 24px; border-top: 1px solid var(--accent); }
@media (min-width: 900px) {
  .intro-grid { grid-template-columns: minmax(0, 1.618fr) minmax(0, 1fr); align-items: end; }
  .intro-copy { margin-bottom: 0.6em; }
}

/* ── Services: the folio, a lamp-black band with numbered rows ── */
.folio { padding-block: clamp(24px, 4vw, 64px) clamp(72px, 8vw, 128px); position: relative; }
.folio::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--on-ink-gold); opacity: 0.5; }
.services { counter-reset: none; }
.service { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 20px; row-gap: 10px; padding-block: clamp(32px, 4vw, 56px); border-bottom: 1px solid color-mix(in srgb, var(--on-ink) 16%, transparent); }
.service::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--on-ink-gold); transform: scaleX(0); transform-origin: 0 50%; transition: transform 900ms var(--ease-out); }
.numeral { grid-row: 1 / span 2; min-width: 2.6ch; font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: clamp(2.75rem, 1.8rem + 3.6vw, 5.5rem); line-height: 0.8; color: var(--on-ink-gold); transition: transform 700ms var(--ease-out); }
.service h3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.875rem, 1.3rem + 2.2vw, 3.5rem); line-height: 1; letter-spacing: -0.01em; color: var(--on-ink); transition: transform 700ms var(--ease-out); }
.service p { color: var(--on-ink-muted); font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem); max-width: 34ch; }
.glyph { display: none; width: 64px; height: 64px; fill: none; stroke: var(--on-ink-gold); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 900px) {
  .service { grid-template-columns: 9rem minmax(0, 1.25fr) minmax(0, 1fr) 64px; column-gap: clamp(24px, 3vw, 56px); align-items: center; }
  .numeral { grid-row: auto; }
  .glyph { display: block; justify-self: end; }
}
@media (hover: hover) {
  .service:hover::after { transform: scaleX(1); }
  .service:hover .numeral { transform: translateX(10px); }
  .service:hover h3 { transform: translateX(6px); }
}
.js .service.reveal .glyph path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1600ms var(--ease-draw) calc(var(--delay, 0ms) + 300ms); }
.js .service.reveal.is-visible .glyph path { stroke-dashoffset: 0; }

/* ── Contact: a full-bleed field of gold leaf; the light follows the pointer ── */
.contact { position: relative; isolation: isolate; overflow: clip; padding-block: clamp(88px, 10vw, 168px); color: var(--field-2-ink); background: var(--field-2); }
.leaf { position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 90% at var(--mx, 28%) var(--my, 20%), var(--leaf-hi) 0%, var(--field-2) 42%, var(--leaf-lo) 100%); transition: background-position 600ms var(--ease-out); }
.contact-layout { display: grid; gap: clamp(36px, 5vw, 64px); }
.contact-line { max-width: 20ch; font-family: var(--font-display); font-weight: 500; font-size: clamp(2.25rem, 1.3rem + 4vw, 5.25rem); line-height: 1.02; letter-spacing: -0.015em; text-wrap: balance; }
.contact-line .mail { font-style: italic; font-weight: 400; overflow-wrap: anywhere; }
.button-ink { display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; max-width: 100%; min-height: 64px; padding: 8px 8px 8px 28px; border-radius: var(--radius-button); background: var(--field-3); color: var(--field-3-ink); font-weight: 600; font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem); letter-spacing: 0.01em; text-decoration: none; overflow-wrap: anywhere; transform: translate3d(var(--bx, 0px), var(--by, 0px), 0); transition: transform 500ms var(--ease-out), box-shadow 500ms var(--ease-out); box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--field-3) 70%, transparent); }
.button-ink:active { transform: translate3d(var(--bx, 0px), var(--by, 0px), 0) scale(0.98); }
.btn-arrow { display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--accent-fill); color: var(--accent-on-fill); transition: transform 500ms var(--ease-out); }
.btn-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-ink:hover .btn-arrow { transform: rotate(45deg); }
.contact :focus-visible { outline-color: var(--field-2-ink); }
@media (min-width: 900px) {
  .contact-layout { grid-template-columns: minmax(0, 1.618fr) minmax(0, 1fr); align-items: end; }
  .contact-action { justify-self: end; }
}
@media (max-width: 559px) { .button-ink { display: flex; width: 100%; padding-left: 22px; } }

/* ── Footer: the colophon ── */
.site-footer { background: var(--bg); padding-block: clamp(56px, 7vw, 96px) 0; overflow: clip; }
.footer-top { display: grid; gap: 24px; padding-bottom: clamp(40px, 6vw, 80px); }
.footer-mark { width: 52px; }
.legal { max-width: 62ch; color: var(--muted); font-size: 0.9375rem; line-height: 1.7; }
@media (min-width: 900px) { .footer-top { grid-template-columns: minmax(0, 1.618fr) minmax(0, 1fr); align-items: start; } .legal { justify-self: end; max-width: 46ch; } }
.colophon { font-family: var(--font-display); font-weight: 500; font-size: clamp(4rem, 19.2vw, 18.5rem); line-height: 0.74; letter-spacing: -0.02em; white-space: nowrap; color: transparent; -webkit-text-stroke: 1px var(--line-strong); margin-bottom: -0.06em; user-select: none; }
.colophon .aureum { font-style: italic; font-weight: 400; -webkit-text-stroke-color: var(--accent); color: transparent; }

/* ── Reduced motion: everything in its end state ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art-wrap, .button-ink { transform: none !important; }
  .js .service.reveal .glyph path { stroke-dashoffset: 0; }
}

/* ── Print: a clean title page on vellum white ── */
@media print {
  body::after, .hero-rules, .hero-art-wrap, .theme-toggle, .header-link, .colophon, .leaf { display: none !important; }
  .line-1, .line-2 { font-size: 54pt; }
  .title .aureum { -webkit-text-fill-color: currentColor; background: none; }
  .folio { background: none; color: var(--ink); }
  .service h3 { color: var(--ink); }
  .service p { color: var(--muted-strong); }
  .numeral { color: var(--accent-text); }
  .contact { background: none; padding-block: 8mm; }
  .button-ink { box-shadow: none; }
}
