/* by Gromov — "Kinetic" main page
   Paper #EAEAEA, ink #231F20, one accent (vermilion stamp). */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/montserrat-500-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+2190-2199, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/montserrat-500-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #EAEAEA;
  --ink: #231F20;
  --mute: #5C5758;
  --line: rgba(35, 31, 32, .16);
  --acc: #D8432B;
  --pad: clamp(16px, 5vw, 72px);
  --ease: cubic-bezier(.2, .75, .1, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 16px/1.5 "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 3px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: 12px; z-index: 50;
  padding: 10px 14px; border-radius: 999px; background: var(--ink); color: var(--paper);
  transform: translateY(-160%); transition: transform .2s;
}
.skip:focus { transform: none; }

.dot {
  display: inline-block; width: .5em; height: .5em; border-radius: 50%;
  background: var(--acc); margin-right: .6em; vertical-align: .08em;
}

/* ---------- header ---------- */
.bar {
  position: absolute; z-index: 6; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(8px, env(safe-area-inset-top)) var(--pad) 0;
  font-size: 15px; letter-spacing: .01em;
}
.bar a { display: inline-flex; align-items: center; min-height: 48px; }
.bar__brand { font-size: 17px; }
/* kinetic: the header stays over the hero; after it, it hides on the way down and returns on the way up */
.k .bar {
  position: fixed; padding-bottom: 4px;
  transition: transform .45s var(--ease), background-color .3s, box-shadow .3s;
}
.k .bar--solid { background: rgba(234, 234, 234, .94); box-shadow: 0 1px 0 var(--line); }
.k .bar--hide { transform: translateY(-110%); }
.bar__nav { display: flex; gap: clamp(18px, 3vw, 40px); }
.bar__nav a { position: relative; min-width: 44px; justify-content: center; }
.bar__nav a::after, .foot a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 12px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease);
}
.bar__nav a:hover::after, .foot a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- hero (static default = no JS / reduced motion) ---------- */
.hero { position: relative; }
.stage {
  --D: min(90vw, 78vh);
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; overflow: hidden;
  padding: 88px 0 96px;
}
@media (max-aspect-ratio: 4/5) { .stage { --D: min(94vw, 62vh); } }
.rings { position: absolute; left: 50%; top: 50%; width: var(--D); aspect-ratio: 3692 / 3727; transform: translate(-50%, -50%); }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--ink); overflow: visible; }

.flap {
  --t: calc(var(--D) * .052);
  position: absolute; left: 50%; top: calc(50% - var(--D) * .05); z-index: 2;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--t) * .22);
  font-size: calc(var(--t) * .76); line-height: 1; letter-spacing: 0;
  user-select: none; -webkit-user-select: none;
}
.flap__row { display: flex; gap: calc(var(--t) * .1); }
@media (max-aspect-ratio: 4/5) and (max-width: 519px) { .hero .flap { --t: calc(var(--D) * .055); } }
.flap__c {
  position: relative; display: grid; place-items: center;
  width: var(--t); height: calc(var(--t) * 1.3);
  border-radius: calc(var(--t) * .12);
  background: var(--ink); color: var(--paper);
  overflow: hidden;
}
.flap__c::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: var(--paper); opacity: .32;
}
.flap__row--by { font-size: calc(var(--t) * .5); }
.flap__row--by .flap__c { width: calc(var(--t) * .66); height: calc(var(--t) * .86); background: var(--acc); }
.flap__c.f1 { animation: flip1 .1s linear; }
.flap__c.f2 { animation: flip2 .1s linear; }
@keyframes flip1 { from { transform: scaleY(.15); } to { transform: none; } }
@keyframes flip2 { from { transform: scaleY(.15); } to { transform: none; } }

.hero__foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  padding: 0 var(--pad) max(22px, env(safe-area-inset-bottom));
  font-size: 15px;
}
.hero__hint { color: var(--mute); display: none; }
.hero__arrow { display: inline-block; }

/* ---------- hero, kinetic mode ---------- */
.k .hero { height: 230vh; height: 230svh; }
.k .hero .stage {
  position: sticky; top: 0; display: block;
  height: 100vh; height: 100svh; min-height: 0; padding: 0;
}
.k .hero .rings { inset: 0; width: auto; aspect-ratio: auto; transform: none; }
/* The letters are drawn by main.js: one <canvas> for the lines and the bend, plus one small canvas per ring
   that holds the finished ring and only rotates while the seal is closed (.rings.spin). The inline SVGs are
   not changed by the script: they give it the outlines, then step aside. They are the picture again whenever
   .k is missing (no JS, reduced motion, script error). */
.rings canvas { display: none; }
.k .rings canvas { display: block; position: absolute; left: 0; top: 0; }
.k .rings__spin { opacity: 0; will-change: transform; }
.k .rings.spin .rings__spin { opacity: 1; }
.k .ring { visibility: hidden; }
.k.ready .ring { display: none; }
.k .hero .flap { opacity: 0; transition: opacity .3s; }
.k .hero .flap.on { opacity: 1; cursor: pointer; }
.flap__row, .flap__c { transition: transform .35s var(--ease), background-color .25s; }
@media (hover: hover) {
  .k .hero .flap.on:hover .flap__row--by { transform: translateY(-3px); }
  .k .hero .flap.on:hover .flap__row:not(.flap__row--by) .flap__c { background: #000; transform: translateY(-1px); }
}
.k .hero .flap:not(.on) .flap__c { animation: none; }
.k .hero__hint { display: block; }
.k .hero__arrow { animation: nudge 1.8s var(--ease) infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(4px); } }
.k .hero__foot { will-change: opacity; }
.k .hero__foot.off { visibility: hidden; }             /* faded out (main.js) */
.k .hero__foot.off .hero__arrow { animation-play-state: paused; }

/* ---------- says ---------- */
.says { padding: clamp(48px, 12vw, 180px) 0 clamp(64px, 10vw, 150px); overflow-x: hidden; overflow-x: clip; }
.says__who { padding: 0 var(--pad); font-size: 15px; margin-bottom: clamp(12px, 2vw, 28px); }
.says__big {
  font-size: clamp(52px, 15vw, 250px); line-height: .9; letter-spacing: -.045em;
}
.says__line { display: block; white-space: nowrap; padding: 0 var(--pad); }
.says__line--1 { color: transparent; -webkit-text-stroke: max(1px, .01em) var(--ink); }
.says__line--2 { text-align: right; }
.k .says__line { will-change: transform; }

/* ---------- section head ---------- */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 0 var(--pad); margin-bottom: clamp(28px, 5vw, 64px);
}
.h2 { font-size: clamp(40px, 7vw, 104px); line-height: 1; letter-spacing: -.035em; }
.sec-head__note { font-size: 15px; color: var(--mute); }

/* ---------- contact ---------- */
.contact { position: relative; isolation: isolate; overflow: hidden; overflow: clip; padding: clamp(56px, 8vw, 110px) 0 clamp(72px, 10vw, 150px); }
.contact__emblem {
  position: absolute; z-index: -1; right: -22vw; top: 8%;
  width: max(520px, 64vw); aspect-ratio: 3692 / 3727;
  background: var(--ink); opacity: .06;
  -webkit-mask: url(../img/emblem.svg) center / contain no-repeat;
  mask: url(../img/emblem.svg) center / contain no-repeat;
  animation: spin 120s linear infinite;
}
.contact.off .contact__emblem { animation-play-state: paused; }   /* Contact is off screen (main.js) */
.contact__mail {
  display: inline-block; margin: 0 var(--pad); padding: 7px 0;   /* >= 44px tap target on phones */
  font-size: clamp(30px, 7.2vw, 140px); line-height: 1.02; letter-spacing: -.045em;
  position: relative; overflow-wrap: anywhere;
}
.contact__mail::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(7px - .04em); height: max(2px, .025em);
  background: var(--acc); transform: scaleX(0); transform-origin: right; transition: transform .6s var(--ease);
}
.contact__mail:hover::after, .contact__mail:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.contact__row {
  display: flex; flex-wrap: wrap; gap: 6px clamp(24px, 4vw, 64px);
  margin: clamp(28px, 4vw, 56px) var(--pad) 0; font-size: 17px;
}
.contact__row a { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }
.contact__row a:hover { color: var(--acc); }

/* ---------- footer ---------- */
.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px var(--pad) max(18px, env(safe-area-inset-bottom));
  background: var(--ink); color: var(--paper); font-size: 14px;
}
.foot ::selection { background: var(--paper); color: var(--ink); }
.foot a { position: relative; display: inline-flex; align-items: center; min-height: 44px; }
.foot a::after { bottom: 10px; }
/* main page: a quiet link to the old site sits next to the brand link; on phones the copyright takes its own row */
.foot p { margin-right: auto; }
.foot .foot__classic { margin-right: clamp(4px, 2vw, 24px); color: rgba(234, 234, 234, .6); transition: color .3s; }
.foot .foot__classic:hover, .foot .foot__classic:focus-visible { color: var(--paper); }
@media (max-width: 519px) { .foot--links { row-gap: 0; } .foot--links p { flex-basis: 100%; } }
/* contact mail (26.11): where the three groups no longer fit one row, the copyright takes its own row and the
   mail starts the second one, left of the links */
@media (min-width: 520px) and (max-width: 759px) { .foot--links { row-gap: 0; } .foot--links p:first-child { flex-basis: 100%; } }
.foot__ico { flex: none; width: 1.1em; height: .8em; margin-right: .55em; }

/* ---------- corner seal ---------- */
.seal {
  position: fixed; z-index: 20;
  right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom));
  width: 88px; height: 88px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--acc); box-shadow: 0 10px 28px -12px rgba(35, 31, 32, .55);
  transition: opacity .35s, transform .6s var(--ease), visibility 0s;
}
.seal__ring {
  position: absolute; inset: 5px; background: var(--paper);
  -webkit-mask: url(../img/seal.svg) center / contain no-repeat;
  mask: url(../img/seal.svg) center / contain no-repeat;
  animation: spin 20s linear infinite;
}
.js .seal:not(.on) .seal__ring { animation-play-state: paused; }  /* hidden seal: its ring rests */
.seal__at { font-size: 24px; line-height: 1; color: var(--paper); transform: translateY(-1px); transition: transform .4s var(--ease); }
.seal:hover .seal__at { transform: translateY(-1px) scale(1.18); }
.seal:hover .seal__ring { animation-duration: 5s; }
.seal__tip {
  position: absolute; right: calc(100% + 10px); top: 50%;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  background: var(--ink); color: var(--paper); font-size: 13px;
  opacity: 0; transform: translate(6px, -50%); transition: opacity .25s, transform .4s var(--ease);
  pointer-events: none;
}
.seal:hover .seal__tip, .seal:focus-visible .seal__tip { opacity: 1; transform: translate(0, -50%); }
.js .seal:not(.on) {
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: scale(.5) rotate(-60deg);
  transition: opacity .3s, transform .5s var(--ease), visibility 0s .5s;
}
/* without JS nothing hides it while the big type passes under it; Contact is linked in the header anyway */
.no-js .seal { display: none; }
@media (min-width: 900px) { .seal { width: 108px; height: 108px; } .seal__ring { inset: 6px; } .seal__at { font-size: 28px; } }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 404 ---------- */
.lost { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; }
.lost .stage { --D: min(84vw, 58vh); min-height: 0; padding: 84px 0 20px; }
.lost .stage > * { grid-area: 1 / 1; }
.lost .flap { position: relative; left: auto; top: auto; transform: translateY(calc(var(--D) * -.04)); --t: calc(var(--D) * .075); }
.lost__emblem {
  width: var(--D); aspect-ratio: 3692 / 3727; background: var(--ink);
  -webkit-mask: url(../img/emblem.svg) center / contain no-repeat;
  mask: url(../img/emblem.svg) center / contain no-repeat;
  animation: spin 60s linear infinite;
}
.lost .flap__row--by .flap__c { width: calc(var(--t) * .9); }
.lost__text { text-align: center; padding: 0 var(--pad) 40px; display: grid; gap: 14px; justify-items: center; }
.lost__text h1 { font-size: clamp(24px, 3.4vw, 40px); letter-spacing: -.02em; text-wrap: balance; }
.lost__text a {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; background: var(--ink); color: var(--paper);
}
.lost__text a:hover { background: var(--acc); }

/* ---------- phones: calm page (html.m, set in <head>: max-width 599px, or a coarse screen at most 500px tall) ----------
   No scroll show: the finished emblem turns slowly by itself (CSS only), and the contacts sit in the first
   screen. Desktop and tablets (.k) are not touched by anything below. svh has a vh fallback (old Safari/Chrome). */
.hero__name, .hero__cta { display: none; }
.m .hero .stage { --D: min(88vw, calc(100vh - 300px)); --cy: calc(50% - 64px); }
@supports (height: 1svh) { .m .hero .stage { --D: min(88vw, calc(100svh - 300px)); } }
.m .hero .rings { top: var(--cy); }
.m .hero .flap { top: calc(var(--cy) - var(--D) * .05); }
.m .ring { transform-origin: 49.98% 49.07%; will-change: transform; }
.m .ring--out { animation: spin 64s linear infinite; }
.m .ring--mid { animation: spin 40s linear infinite reverse; }
.m .ring--in  { animation: spin 24s linear infinite; }
.m .hero__foot { flex-direction: column; align-items: stretch; gap: 14px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.m .hero__name { display: block; color: var(--ink); font-size: 17px; }
.m .hero__kicker { color: var(--mute); line-height: 1.4; }
.m .hero__cta { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 54px; padding: 0 22px; border-radius: 999px; font-size: 16px;
  border: 1.5px solid var(--ink); transition: background-color .2s, color .2s;
}
.cta__k { flex: none; }
.cta__v { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cta--tg { background: var(--ink); color: var(--paper); }
.cta--tg .cta__k::before { content: ""; display: inline-block; width: .5em; height: .5em; margin-right: .6em; border-radius: 50%; background: var(--acc); vertical-align: .08em; }
.cta--mail { color: var(--ink); }
.cta:active { background: var(--acc); border-color: var(--acc); color: var(--paper); }
@media (max-width: 359px) { .cta { padding: 0 16px; font-size: 15px; } }
@media (max-width: 299px) { .cta { justify-content: center; } .cta__k { display: none; } }   /* folded phones: just the address */
/* phone on its side (520px+ wide): emblem on the left, name and buttons on the right.
   Narrower landscape windows (split screen) keep the stacked layout above. */
@media (orientation: landscape) and (min-width: 520px) {
  .m .hero .stage { --D: min(42vw, calc(100vh - 92px)); --cy: calc(50% + 16px); }
  @supports (height: 1svh) { .m .hero .stage { --D: min(42vw, calc(100svh - 92px)); } }
  .m .hero .rings, .m .hero .flap { left: 25%; }
  .m .hero__foot { top: 0; left: 50%; justify-content: center; gap: 12px;
    padding: 56px max(var(--pad), env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) 0; }
  .m .hero__cta { gap: 8px; }
  .m .cta { min-height: 50px; padding: 0 18px; font-size: 15px; }
}
/* narrow side-by-side column: label above the address, so the full address always fits */
@media (orientation: landscape) and (min-width: 520px) and (max-width: 639px) {
  .m .cta { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; line-height: 1.25; padding: 4px 20px; }
  .m .cta__k { font-size: 12px; opacity: .75; }
  .m .cta__v { max-width: 100%; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
