/* aevum — style */

:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #4a4a4a;
  --ink-3: #8a8a8a;
  --line: #d9d9d9;
  --gutter: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-decoration: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Canvas ------------------------------------------------------------- */

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.8s ease;
}
html.has-bg #bg { opacity: 1; }
html.no-bg #bg { display: none; }
html.no-bg body {
  background:
    radial-gradient(rgba(0, 0, 0, 0.16) 0.8px, transparent 1px) 0 0 / 14px 14px,
    var(--paper);
}

/* Header -------------------------------------------------------------- */

.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(18px, 2.4vw, 28px) var(--gutter);
  padding-top: calc(clamp(18px, 2.4vw, 28px) + env(safe-area-inset-top));
  pointer-events: none;
}
.top > * { pointer-events: auto; }

.mark {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  opacity: 0;
}
html.docked .mark, html.static-mark .mark { opacity: 1; }
.mark .l, .hero-mark .l { display: inline-block; transform-origin: center center; will-change: transform; }

.top-link {
  font-size: 14px;
  color: var(--ink-2);
  padding: 8px 0;
  position: relative;
  transition: color 0.3s var(--ease);
}
.top-link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.top-link:hover { color: var(--ink); }
.top-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* Layout -------------------------------------------------------------- */

main, .foot { position: relative; z-index: 1; }

/* Hero ---------------------------------------------------------------- */

.hero { height: 175vh; height: 175svh; }

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-mark {
  font-size: clamp(64px, 17vw, 240px);
  will-change: filter;
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
  transform-origin: center center;
  will-change: transform;
  white-space: nowrap;
  opacity: 0;
  animation: markIn 1.4s var(--ease) 0.1s forwards;
}
@keyframes markIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
html.docked .hero-mark { visibility: hidden; }
html.static-mark .hero-mark { visibility: visible; }

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(24px, 4vh, 44px);
  width: 22px;
  height: 36px;
  margin-left: -11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  opacity: 0;
  animation: markIn 1s ease 1.2s forwards;
}
.scroll-hint span {
  position: absolute;
  left: 50%; top: 6px;
  width: 2px; height: 6px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--ink-3);
  animation: hint 2.2s var(--ease) infinite;
}
@keyframes hint {
  0%   { transform: translateY(0);    opacity: 0; }
  20%  { opacity: 1; }
  80%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* Intro --------------------------------------------------------------- */

.intro {
  min-height: 60vh;
  min-height: 60svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10vh var(--gutter) 12vh;
}

.words {
  font-size: clamp(40px, 7vw, 104px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.28em;
}

.lede {
  margin-top: clamp(28px, 4vh, 44px);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 44ch;
  text-wrap: pretty;
}

/* Contact ------------------------------------------------------------- */

.contact {
  padding: clamp(32px, 6vh, 80px) var(--gutter) clamp(80px, 14vh, 160px);
}

.contact-inner {
  max-width: 560px;
  margin: 0 auto;
}

.label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 28px;
}

.field { position: relative; margin-bottom: 26px; }
.field.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 6px;
  transition: color 0.3s;
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: clamp(18px, 1.5vw, 21px);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 6px 0 12px;
  outline: none;
  resize: vertical;
  transition: border-color 0.3s var(--ease);
  -webkit-appearance: none;
}
.field input:focus, .field textarea:focus { border-color: var(--ink); }
.field:focus-within label { color: var(--ink); }
.field .invalid { border-color: #c2413a; }

.hint { display: block; min-height: 18px; font-size: 13px; color: #c2413a; margin-top: 6px; }

.actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 8px; }

#submit {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 14px 24px 14px 28px;
  cursor: pointer;
  transition: transform 0.45s var(--ease), opacity 0.3s;
}
#submit svg { transition: transform 0.45s var(--ease); }
#submit:hover { transform: translateY(-2px); }
#submit:hover svg { transform: translateX(3px); }
#submit:active { transform: translateY(0); }
#submit:disabled { opacity: 0.5; cursor: default; transform: none; }
#submit:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.or { font-size: 14px; color: var(--ink-3); }
.or a { color: var(--ink); border-bottom: 1px solid var(--line); transition: border-color 0.3s; }
.or a:hover { border-color: var(--ink); }

.status { margin-top: 16px; font-size: 14px; color: var(--ink-2); min-height: 20px; }

/* Footer -------------------------------------------------------------- */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding: 24px var(--gutter);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--ink-3);
}
.foot nav { display: flex; gap: 24px; }
.foot a { transition: color 0.3s; }
.foot a:hover { color: var(--ink); }

/* Reveal -------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* Responsive ---------------------------------------------------------- */

@media (min-width: 1800px) {
  .hero-mark { font-size: 280px; }
  .words { font-size: 120px; }
}

@media (max-width: 1024px) and (min-width: 761px) {
  .words { font-size: clamp(52px, 8.5vw, 88px); }
}

@media (max-width: 760px) {
  .hero { height: 165vh; height: 165svh; }
  .words { flex-direction: column; gap: 0.08em 0; font-size: clamp(44px, 14vw, 72px); }
  .foot { flex-direction: column; align-items: flex-start; }
  .contact { padding-bottom: 64px; }
  .actions { gap: 14px; }
}

@media (max-width: 380px) {
  .hero-mark { font-size: 60px; }
  .words { font-size: 40px; }
  .lede { font-size: 16px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .hero-mark { font-size: clamp(56px, 12vw, 120px); }
  .intro { min-height: auto; padding: 18vh var(--gutter); }
}

@media (prefers-reduced-motion: reduce) {
  .hero { height: auto; }
  .hero-mark, .scroll-hint { animation: none; opacity: 1; }
  .scroll-hint span { animation: none; opacity: 1; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
