:root {
  --paper: #efebe2;
  --paper-2: #e6e1d5;
  --ink: #15140f;
  --ink-soft: #5d594e;
  --rule: #cfc8b8;
  --signal: #ff4a1c;
  --dots: rgba(255, 74, 28, 0.55);
  --grain-opacity: 0.07;
  --display: "Unbounded", "Arial Black", sans-serif;
  --body: "Geologica", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12110d;
    --paper-2: #1b1a15;
    --ink: #eee9dd;
    --ink-soft: #9d978a;
    --rule: #34312a;
    --signal: #ff5a2e;
    --dots: rgba(255, 90, 46, 0.5);
    --grain-opacity: 0.05;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  font-size: clamp(15px, 1.05vw + 10px, 18px);
  line-height: 1.5;
  overflow-x: hidden;
}

::selection { background: var(--signal); color: var(--paper); }

a { color: inherit; }

.grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 10;
  opacity: var(--grain-opacity);
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* top bar */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter) 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.glyph { width: 30px; height: 30px; display: block; }
.glyph path { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: miter; }
.glyph circle { fill: var(--signal); }

.lang { display: flex; gap: 4px; }
.lang a {
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-soft);
  transition: color .2s, border-color .2s;
}
.lang a:hover { color: var(--ink); border-color: var(--rule); }
.lang a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }

/* hero */
main { flex: 1; display: flex; flex-direction: column; }

.hero { padding: clamp(28px, 7vh, 88px) var(--gutter) 0; }

.word {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(44px, 14.5vw, 232px);
  line-height: 0.86;
  letter-spacing: -0.045em;
  white-space: nowrap;
}
.word .dot { color: var(--signal); }
.word span.ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.18em) skewY(6deg);
  animation: rise .9s cubic-bezier(.2, .8, .2, 1) forwards;
}

.tag {
  margin: clamp(16px, 3vh, 30px) 0 0;
  max-width: 34ch;
  font-size: clamp(18px, 1.6vw + 8px, 30px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  opacity: 0;
  animation: fade .8s ease .7s forwards;
}
.tag::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.45em;
  background: var(--signal);
  clip-path: polygon(0 100%, 30% 25%, 50% 70%, 75% 0, 100% 100%);
  vertical-align: 0.02em;
}

/* the jagged frontier */
.frontier {
  display: block;
  width: 100%;
  height: clamp(200px, 38vh, 440px);
  margin-top: clamp(8px, 2vh, 24px);
}
.frontier .expect {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1;
  stroke-dasharray: 3 7;
  opacity: 0;
  animation: fade 1s ease .2s forwards;
}
.frontier .area { fill: url(#dots); opacity: 0; animation: fade 1.4s ease 2s forwards; }
.frontier .line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linejoin: miter;
  stroke-miterlimit: 10;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.6s cubic-bezier(.65, 0, .25, 1) .5s forwards;
}
.frontier .pin { fill: var(--signal); opacity: 0; animation: fade .4s ease 3s forwards; }
.frontier .halo { fill: var(--signal); opacity: 0; transform-box: fill-box; transform-origin: center; }
.frontier.live .halo { animation: halo 2.4s ease-out 3s infinite; }
.frontier.settled .line { stroke-dashoffset: 0; animation: none; }
.frontier.settled .area,
.frontier.settled .expect,
.frontier.settled .pin { opacity: 1; animation: none; }
.frontier.settled .expect { opacity: 1; }
.dotfill { fill: var(--dots); }

/* contacts */
.contacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(20px, 3vw, 48px);
  margin: 0 var(--gutter);
  padding: clamp(20px, 3.5vh, 36px) 0;
  border-top: 1px solid var(--ink);
  font-style: normal;
  opacity: 0;
  animation: fade .8s ease 1.1s forwards;
}
.contacts > div { min-width: 0; }
.label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.contacts p { margin: 0; overflow-wrap: anywhere; }
.legal { font-weight: 500; }
.mail {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(17px, 1.3vw + 8px, 24px);
  letter-spacing: -0.02em;
  text-decoration: none;
  background: linear-gradient(var(--signal), var(--signal)) 0 100% / 0 2px no-repeat;
  transition: background-size .35s cubic-bezier(.2, .8, .2, 1);
  padding-bottom: 2px;
}
.mail:hover,
.mail:focus-visible { background-size: 100% 2px; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter) 22px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

a:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes halo {
  0% { opacity: .45; transform: scale(1); }
  100% { opacity: 0; transform: scale(4); }
}

@media (max-width: 760px) {
  .contacts { grid-template-columns: 1fr; gap: 18px; }
  .frontier { height: clamp(180px, 30vh, 300px); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; }
  .frontier .halo { display: none; }
}

/* 404 */
.lost { padding: clamp(28px, 7vh, 88px) var(--gutter); }
.lost a { color: var(--signal); }
