/* All tunable design values live in :root. */
:root {
  --bg: #111316;
  --text: #ece6dc;        /* warm off-white */
  --muted: #9a9890;       /* secondary text */
  --faint: #82817b;       /* footer; kept >= 4.5:1 on --bg for accessibility */
  --rule: #3a3d42;        /* divider */

  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --tracking-caps: 0.28em;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/cormorant-garamond-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  /* Preloaded, so it is almost always ready for first paint; "optional" means
     a slow connection keeps the fallback instead of swapping (no layout shift). */
  font-display: optional;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  padding:
    env(safe-area-inset-top)
    max(1.5rem, env(safe-area-inset-right))
    0
    max(1.5rem, env(safe-area-inset-left));
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Lift the group slightly above true center; reads as optically centered. */
  padding: 4rem 0 6vh;
}

.name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 1.6rem + 5.2vw, 5.75rem);
  line-height: 1.05;
  letter-spacing: 0.005em;
  font-kerning: normal;
}

.rule {
  width: 2.5rem;
  height: 0;
  margin: clamp(1.5rem, 1.2rem + 1vw, 2.25rem) auto;
  border: 0;
  border-top: 1px solid var(--rule);
}

.place,
footer p {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  /* Tracking adds trailing space after the last letter; indent by the same
     amount so caps text stays truly centered. */
  text-indent: var(--tracking-caps);
}

.place {
  font-size: 0.75rem;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2.25rem;
  margin: clamp(2.5rem, 2rem + 2vw, 3.5rem) 0 0;
}

.contact {
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  text-decoration-color: var(--rule);
  transition: color 200ms ease, text-decoration-color 200ms ease;
}

.contact:hover {
  color: var(--text);
  text-decoration-color: var(--muted);
}

.contact:focus-visible {
  color: var(--text);
  outline: 1px solid var(--muted);
  outline-offset: 0.5em;
  border-radius: 2px;
}

.arrow {
  font-size: 0.85em;
}

footer {
  text-align: center;
  padding-bottom: max(1.75rem, calc(env(safe-area-inset-bottom) + 0.75rem));
}

footer p {
  font-size: 0.625rem;
  color: var(--faint);
}

@media (prefers-reduced-motion: reduce) {
  .contact {
    transition: none;
  }
}

/* Printed texture: grey noise tile blended in overlay mode, so it adds grain
   without lifting the charcoal. Root carries the background so body's paints
   inside the isolated group the grain blends with. */
html {
  background: var(--bg);
}

body {
  isolation: isolate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1 0 0 0 -0.22 1 0 0 0 -0.22 1 0 0 0 -0.22 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  mix-blend-mode: overlay;
  opacity: 0.45;
}

/* Gentle fade-in on load. Opacity only (no movement), so it also suits Reduce Motion. */
main,
footer {
  animation: fade-in 900ms ease-out both;
}

footer {
  animation-delay: 300ms;
}

@keyframes fade-in {
  /* 0.01, not 0: Chrome ignores fully transparent text when measuring page speed (LCP). */
  from { opacity: 0.01; }
  to   { opacity: 1; }
}
