/*
 * VIEM. — shared styles: tokens, base, header, menu, footer, motion, Georgian edition.
 * Page styles: home.css (index) and inner.css (every other page).
 */

/* Tokens ----------------------------------------------------------------- */
:root {
	--ink: #0c0c0b;
	--ivory: #f0ece3;
	--bone: #d8d0c1;
	--gold: #aa9570;        /* Accents and text on dark surfaces. */
	--gold-deep: #76633f;   /* Text and focus rings on light surfaces (4.9:1 on ivory). */
	--red: #762e24;
	--line-dark: rgba(240, 236, 227, .22);
	--line-light: rgba(12, 12, 11, .22);
	--side: clamp(20px, 3.1vw, 54px);
	--small: max(.88rem, 14px);
	--display: "Libre Caslon Display", Georgia, serif;
	--text: "Libre Caslon Text", Georgia, serif;
	--ease-luxury: cubic-bezier(.16, 1, .3, 1);
	--motion-fast: 220ms;
	--motion-medium: 480ms;
	--motion-reveal: 850ms;
	--focus: var(--gold-deep);
}

/* Surfaces where focus rings use the light gold. */
.site-footer, .menu, .page-hero, .contact-hero, .hero-scroll, .rail-wrap, .mask-break,
.disciplines, .project-hero, .project-story, .image-viewer { --focus: var(--gold); }

/* Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; font-style: normal; }
html { scrollbar-gutter: stable; scroll-padding-top: 80px; }
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--text); font-size: 16px; overflow-x: clip; }
body.menu-open, body.viewer-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; }

.skip-link { position: fixed; z-index: 300; left: var(--side); top: -80px; padding: 10px 16px; background: var(--ivory); color: var(--ink); font-size: var(--small); }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: viem-page-out 180ms ease-out both; }
::view-transition-new(root) { animation: viem-page-in 180ms ease-out both; }
@keyframes viem-page-out { to { opacity: 0; } }
@keyframes viem-page-in { from { opacity: 0; } }

/* Texture, progress and cursor ------------------------------------------- */
.grain { position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .035; mix-blend-mode: soft-light; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.progress { position: fixed; z-index: 110; left: 0; top: 0; height: 2px; width: 100%; transform: scaleX(0); transform-origin: left; background: var(--gold); }
.cursor { display: none; position: fixed; z-index: 200; left: 0; top: 0; width: 54px; height: 54px; border: 1px solid rgba(255, 255, 255, .85); border-radius: 50%; pointer-events: none; mix-blend-mode: difference; transition: width var(--motion-medium) var(--ease-luxury), height var(--motion-medium) var(--ease-luxury); }
.cursor.is-link { width: 72px; height: 72px; }
@media (pointer: fine) {
	.cursor { display: block; }
	a, button { cursor: none; }
}

/* Header ------------------------------------------------------------------
 * Over a cover the controls take their colour from the pixels beneath them
 * (data-ink, set by site.js). Once the page scrolls the bar becomes a solid
 * surface matching the section under it (.on-light). */
.site-header {
	position: fixed; inset: 0 0 auto; z-index: 90;
	height: 88px; padding: 0 var(--side);
	display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
	color: #fff; background: transparent;
	transition: height var(--motion-medium) var(--ease-luxury);
}
.site-header :focus-visible { outline-color: currentColor; }
.site-header [data-ink="dark"] { color: var(--ink); }
.site-header [data-ink="light"] { color: #fff; }
.site-header[data-blend] { mix-blend-mode: difference; }
.site-header.is-settled { height: 72px; background: var(--ink); color: #fff; mix-blend-mode: normal; }
.site-header.is-settled.on-light { background: var(--ivory); color: var(--ink); }
.site-header.is-settled [data-ink] { color: inherit; }
body.menu-open .site-header { background: transparent; color: #fff; mix-blend-mode: normal; }
body.menu-open .site-header [data-ink] { color: #fff; }

.wordmark { font: 400 2rem/1 var(--display); letter-spacing: .08em; }
.wordmark i { color: var(--gold); }
.header-note { justify-self: center; font-size: var(--small); line-height: 1.35; letter-spacing: .035em; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 12px; }
.menu-button { border: 0; background: transparent; padding: 14px 0 14px 8px; font-size: var(--small); line-height: 1.35; letter-spacing: .035em; cursor: pointer; }
.lang-switch {
	width: 44px; height: 44px; display: grid; place-items: center;
	border: 1px solid currentColor; font-size: 14px; line-height: 1;
	transition: color var(--motion-fast), background-color var(--motion-fast), border-color var(--motion-fast);
}

/* Menu --------------------------------------------------------------------- */
.menu {
	position: fixed; inset: 0; z-index: 85;
	padding: 130px var(--side) 42px;
	background: var(--ink); color: #fff;
	opacity: 0; visibility: hidden; transform: translateY(-14px);
	transition: opacity var(--motion-medium) var(--ease-luxury), transform var(--motion-medium) var(--ease-luxury), visibility var(--motion-medium);
}
/* Visible at once when opening (so focus can move in); hidden only after the fade when closing. */
.menu-open .menu { opacity: 1; visibility: visible; transform: none; transition: opacity var(--motion-medium) var(--ease-luxury), transform var(--motion-medium) var(--ease-luxury), visibility 0s; }
.menu nav { display: flex; flex-direction: column; align-items: flex-start; }
.menu nav a {
	font: 400 clamp(4rem, 10vw, 10.5rem)/.86 var(--display); letter-spacing: -.055em;
	opacity: 0; transform: translateY(16px);
	transition: opacity var(--motion-medium) var(--ease-luxury), transform var(--motion-medium) var(--ease-luxury), color var(--motion-fast), padding-left var(--motion-medium) var(--ease-luxury);
}
.menu nav a:hover, .menu nav a:focus-visible, .menu nav a[aria-current="page"] { color: var(--gold); }
.menu nav a:hover { padding-left: .22em; }
.menu-open .menu nav a { opacity: 1; transform: none; }
.menu-open .menu nav a:nth-child(2) { transition-delay: 35ms; }
.menu-open .menu nav a:nth-child(3) { transition-delay: 70ms; }
.menu-open .menu nav a:nth-child(4) { transition-delay: 105ms; }
.menu-open .menu nav a:nth-child(5) { transition-delay: 140ms; }
.menu-foot { position: absolute; inset: auto var(--side) 36px; display: flex; justify-content: space-between; border-top: 1px solid var(--line-dark); padding-top: 14px; font-size: var(--small); line-height: 1.35; }

/* Footer --------------------------------------------------------------------- */
.site-footer { padding: 8vh var(--side) 32px; background: var(--ink); color: var(--ivory); display: flex; flex-direction: column; gap: clamp(55px, 9vh, 100px); }
.footer-kicker { display: flex; justify-content: space-between; font-size: var(--small); line-height: 1.35; }
.contact-link { align-self: flex-start; font: 400 clamp(5rem, 14vw, 15rem)/.75 var(--display); letter-spacing: -.065em; border-bottom: .035em solid var(--gold); transition: color var(--motion-fast); }
.contact-link:hover { color: var(--gold); }
.footer-bottom { padding-top: 14px; border-top: 1px solid var(--line-dark); display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 30px; font-size: var(--small); line-height: 1.35; }
.footer-bottom span:last-child { text-align: right; }
.footer-bottom a:hover { color: var(--gold); }

/* Shared type ------------------------------------------------------------------ */
.eyebrow { font-size: var(--small); line-height: 1.35; letter-spacing: .05em; }
h2.eyebrow { margin: 0; font-weight: 400; }

/* Reveal on scroll (only once scripts are running, so content never stays hidden). */
.js .reveal { opacity: 0; transform: translateY(22px); }
.js .reveal.visible { opacity: 1; transform: none; transition: opacity var(--motion-reveal) var(--ease-luxury), transform var(--motion-reveal) var(--ease-luxury); }

@media (max-width: 760px) {
	.site-header { height: 70px; grid-template-columns: 1fr 1fr; }
	.site-header.is-settled { height: 64px; }
	.header-note { display: none; }
	.lang-switch { width: 38px; height: 38px; }
	.header-actions { gap: 8px; }
	.menu { padding-top: 110px; }
	.menu nav a { font-size: 17vw; }
	.site-footer { gap: 48px; padding-top: 7vh; }
	.footer-bottom { grid-template-columns: 1fr 1fr; }
	.footer-bottom span:nth-child(2) { display: none; }
}

/* Georgian edition -------------------------------------------------------------- */
html[lang="ka"] {
	--ka-serif: "BPG Classic", "Libre Caslon Text", "Noto Serif Georgian", Georgia, serif;
	--ka-display: "BPG Classic", "Libre Caslon Display", "Noto Serif Georgian", Georgia, serif;
	--ka-body: clamp(1.3125rem, 1.15rem + .3vw, 1.5rem);
	--ka-small: clamp(1.0625rem, 1rem + .12vw, 1.1875rem);
}
html[lang="ka"] body { font-family: var(--ka-serif); font-size: var(--ka-body); font-synthesis: none; line-height: 1.65; }
html[lang="ka"] :is(h1, h2, h3, blockquote, .display, .contact-link, .mask-type, .menu nav a, .next a) {
	font-family: var(--ka-display); font-weight: 400; letter-spacing: 0;
	overflow-wrap: break-word; text-wrap: balance;
}
html[lang="ka"] :is(.display, .contact-hero h1) { font-size: clamp(2.625rem, .9rem + 6.2vw, 8rem); line-height: 1.14; max-width: 16ch; margin-block: .12em; }
html[lang="ka"] .page-hero { gap: clamp(28px, 4vh, 52px); }
html[lang="ka"] :is(.statement blockquote, .manifesto blockquote) { font-size: clamp(2.125rem, .9rem + 3.3vw, 4.75rem); line-height: 1.28; }
html[lang="ka"] .disciplines-head h2 { font-size: clamp(2.25rem, .9rem + 4vw, 5.25rem); line-height: 1.18; }
html[lang="ka"] :is(.intro h2, .project-facts h2, .numbers h2) { font-size: clamp(2rem, .8rem + 3vw, 4rem); line-height: 1.25; }
html[lang="ka"] :is(.discipline h3, .principle h3) { font-size: clamp(1.875rem, .9rem + 2.2vw, 3.5rem); line-height: 1.2; }
html[lang="ka"] .service h2 { font-size: clamp(1.875rem, .9rem + 1.75vw, 2.875rem); line-height: 1.25; }
html[lang="ka"] .menu nav { gap: clamp(10px, 2vh, 22px); }
html[lang="ka"] .menu nav a { font-size: clamp(2.25rem, .9rem + 5vw, 6rem); line-height: 1.16; max-width: 100%; }
html[lang="ka"] .contact-link { font-size: clamp(2.25rem, .8rem + 6vw, 7.5rem); line-height: 1.22; max-width: 100%; padding-bottom: .06em; }
html[lang="ka"] .mask-type { font-size: clamp(4rem, 18vw, 19rem); line-height: 1.12; }
html[lang="ka"] .next a:nth-child(2) { font-family: var(--ka-serif); font-size: 1.3125rem; line-height: 1.5; }
html[lang="ka"] :is(.statement-note p, .discipline p, .intro p, .principle p, .service p, .service li, .project-story p, .hero-bottom p, .contact-details p, .contact-details a, .contact-field input, .contact-field textarea, .contact-field select, .contact-sent p, .content) {
	font-family: var(--ka-serif); font-size: var(--ka-body); line-height: 1.7; letter-spacing: 0;
}
html[lang="ka"] :is(.statement-note p, .intro p, .service p, .project-story p, .hero-bottom p) { max-width: 60ch; }
html[lang="ka"] :is(.header-note, .menu-button, .lang-switch, .menu-foot, .eyebrow, .hero-line, .hero-project p, .scroll-mark, .statement-note span, .rail-head, .rail-copy i, .mask-type small, .mask-outline, .disciplines-head > span, .number i, .footer-kicker, .footer-bottom, .fact dt, .fact dd, .work-card span, .service-label, .contact-field label, .contact-details h2, .contact-submit, .filter-button, .stat i, .project-title p, .image-viewer figcaption, .image-viewer button, .field-error, .form-error) {
	font-family: var(--ka-serif); font-size: var(--ka-small); font-weight: 400; line-height: 1.5; letter-spacing: 0;
}
html[lang="ka"] .contact-submit { font-size: 1.1875rem; }
html[lang="ka"] :is(.hero-line, .footer-kicker, .menu-foot) { gap: 16px; }
html[lang="ka"] .footer-bottom { align-items: start; }
html[lang="ka"] :is(.statement, .disciplines-head, .discipline, .intro, .manifesto, .principle, .service, .project-facts, .project-story, .hero-bottom) > * { min-width: 0; }
/* Latin lettering — the wordmark and project titles — keeps its own metrics in both editions. */
html[lang="ka"] .wordmark { font: 400 2rem/1 var(--display); letter-spacing: .08em; }

@media (max-width: 1100px) {
	html[lang="ka"] .site-header { grid-template-columns: 1fr 1fr; }
	html[lang="ka"] .header-note { display: none; }
}
@media (max-width: 760px) {
	html[lang="ka"] { --ka-body: 1.3125rem; --ka-small: 1.0625rem; }
	html[lang="ka"] :is(.display, .contact-hero h1) { font-size: clamp(2.125rem, 8.5vw, 3.5rem); }
	html[lang="ka"] :is(.statement blockquote, .manifesto blockquote) { font-size: clamp(1.875rem, 7vw, 2.875rem); }
	html[lang="ka"] .contact-link { font-size: clamp(1.875rem, 8.7vw, 3.75rem); }
	html[lang="ka"] .menu nav { gap: 14px; }
	html[lang="ka"] .menu nav a { font-size: clamp(2.125rem, 9vw, 3.75rem); }
	html[lang="ka"] .service h2 { font-size: clamp(1.625rem, 6.4vw, 2.125rem); }
	html[lang="ka"] :is(.hero-line, .footer-kicker, .menu-foot) { font-size: 1rem; flex-wrap: wrap; }
	html[lang="ka"] .footer-bottom { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	html[lang="ka"] .footer-bottom span:last-child { text-align: left; }
	html[lang="ka"] .hero-bottom > span { text-align: left; font-size: var(--ka-small); }
}

/* Project titles are always set in Latin display type, in either edition. */
.project-title h1, .work-card h2, .rail-copy b, .next a[rel], .hero-project h2 {
	font-family: var(--display); font-weight: 400; line-height: 1.12; letter-spacing: -.025em;
}
html[lang="ka"] :is(.project-title h1, .work-card h2, .next a[rel], .hero-project h2) { font-family: var(--display); letter-spacing: -.025em; text-wrap: wrap; }

/* Reduced motion and touch ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce), (any-pointer: coarse) {
	@view-transition { navigation: none; }
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
	.js .reveal, .menu nav a { transform: none; }
	.js .reveal { opacity: 1; }
	.cursor { display: none; }
	a, button { cursor: pointer; }
	[data-parallax] { transform: none; }
}
@media (any-pointer: coarse) {
	.grain { display: none; }
}
