@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-sans-regular.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --ink: #f3eee6;
  --mute: rgba(232, 224, 210, 0.58);
  --line: rgba(243, 238, 230, 0.38);
  --shore: #07080c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--shore);
}

html {
  min-height: 100%;
  scrollbar-color: rgba(243, 238, 230, 0.28) transparent;
}

body {
  min-height: 220dvh;
  color: var(--ink);
  font-family: "Instrument Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(214, 196, 166, 0.32);
  color: #fffaf3;
}

.veil,
#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.veil {
  z-index: 0;
  background:
    radial-gradient(90% 70% at 48% 28%, rgba(92, 78, 58, 0.55), transparent 58%),
    radial-gradient(50% 42% at 78% 62%, rgba(48, 62, 74, 0.4), transparent 62%),
    radial-gradient(40% 32% at 18% 78%, rgba(64, 48, 32, 0.18), transparent 70%),
    var(--shore);
}

#field {
  z-index: 1;
  display: block;
  background: transparent;
  touch-action: pan-y;
}

/* Copy sits in the field — no glass badge */
.copy {
  position: fixed;
  z-index: 2;
  left: max(1.75rem, env(safe-area-inset-left));
  bottom: max(1.75rem, env(safe-area-inset-bottom));
  width: min(34rem, calc(100vw - 3.5rem));
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translate3d(var(--shift-x, 0px), var(--shift-y, 0px), 0);
}

.copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: -2.5rem -3rem -3rem -2.25rem;
  background: radial-gradient(
    70% 75% at 28% 72%,
    rgba(7, 8, 12, 0.78) 0%,
    rgba(7, 8, 12, 0.35) 42%,
    transparent 72%
  );
}

.name,
.thesis,
.mail {
  position: relative;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.45);
}

.name {
  margin: 0 0 1.15rem;
  color: var(--mute);
  font-family: "Instrument Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.2;
}

.thesis {
  margin: 0;
  max-width: 28rem;
  font-family: "Instrument Serif", "Iowan Old Style", Palatino, Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.45rem, 1.1vw + 1.15rem, 1.95rem);
  line-height: 1.28;
  letter-spacing: -0.018em;
  color: var(--ink);
}

.thesis-2 {
  margin-top: 0.85rem;
  color: rgba(243, 238, 230, 0.82);
  font-size: clamp(1.2rem, 0.7vw + 1rem, 1.45rem);
  line-height: 1.34;
  letter-spacing: -0.012em;
}

.mail {
  display: inline-block;
  margin: 1.55rem 0 0;
  color: var(--ink);
  font-family: "Instrument Serif", "Iowan Old Style", Palatino, Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.06rem;
}

.mail:hover {
  border-bottom-color: rgba(243, 238, 230, 0.9);
}

.mail:focus-visible {
  outline: 1px solid rgba(243, 238, 230, 0.85);
  outline-offset: 5px;
  border-radius: 2px;
}

@media (max-width: 640px) {
  .copy {
    left: max(1.15rem, env(safe-area-inset-left));
    right: max(1.15rem, env(safe-area-inset-right));
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    width: auto;
  }

  .copy::before {
    inset: -1.75rem -1.5rem -2rem -1.25rem;
  }

  .name {
    margin-bottom: 0.95rem;
    letter-spacing: 0.18em;
  }

  .thesis {
    font-size: clamp(1.35rem, 5.6vw, 1.65rem);
    max-width: none;
  }

  .thesis-2 {
    font-size: clamp(1.12rem, 4.4vw, 1.28rem);
  }

  .mail {
    font-size: 1rem;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    min-height: 100dvh;
  }

  #field {
    display: none;
  }

  .copy {
    transform: none;
  }
}

html.static body {
  min-height: 100dvh;
}

html.static #field {
  display: none;
}
