@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* Palette and type from the Calariam brand canvas: old gold is the only accent */
:root {
  --ink: #12100E;
  --ink-raised: #191613;
  --ink-deep: #0E0C0B;
  --gold: #B8862F;
  --gold-hover: #C6943B;
  --gold-text: #C99A48;            /* gold lifted a touch for small text on ink */
  --gold-soft: rgba(184, 134, 47, 0.14);
  --bone: #EDE7DF;
  --on-gold: #12100E;              /* bone on gold is only 3:1, so buttons use ink */
  --body: rgba(237, 231, 223, 0.78);
  --muted: rgba(237, 231, 223, 0.6);
  --ash: rgba(237, 231, 223, 0.46);
  --faint: rgba(237, 231, 223, 0.28);
  --rail: rgba(237, 231, 223, 0.09);
  --rail-strong: rgba(237, 231, 223, 0.16);

  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --track: 0.22em;                 /* wordmark tracking */
  --max: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --nav-h: 68px;
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

/* Column layout so the footer sits at the bottom on short pages */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--ink);
  color: var(--bone);
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 500;
  font-synthesis: none;      /* one weight only, so never fake a bold */
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
strong, b { font-weight: 500; color: var(--bone); }
i { font-style: normal; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--gold-text);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--gold);
  color: var(--on-gold);
  border-radius: var(--radius);
}
.skip:focus { top: 12px; }

.container {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform 200ms var(--ease);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }

.btn-solid { background: var(--gold); color: var(--on-gold); }
.btn-solid:hover { background: var(--gold-hover); }

.btn-outline { border-color: var(--gold); color: var(--bone); }
.btn-outline:hover { background: var(--gold-soft); border-color: var(--gold-hover); }

.btn:hover .icon { transform: translateX(3px); }

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(18, 16, 14, 0.86);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--rail);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  height: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
}
.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--gold);
  stroke-width: 8;
}
.brand-word {
  font-size: 15px;
  letter-spacing: var(--track);
  margin-right: calc(-1 * var(--track));
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 34px);
  font-size: 14px;
  color: var(--muted);
}
.nav-links a {
  position: relative;
  padding: 6px 0;
  transition: color 160ms ease;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--bone); }
/* Current page: a gold rule along the bottom of the header */
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc((var(--nav-h) - 100%) / -2);
  height: 2px;
  background: var(--gold);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.menu-toggle {
  display: none;
  position: relative;
  width: 38px;
  height: 38px;
  border: 1px solid var(--rail-strong);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}
.menu-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1.5px;
  background: var(--bone);
  transition: transform 200ms var(--ease), top 200ms var(--ease);
}
.menu-toggle span:first-child { top: 14px; }
.menu-toggle span:last-child { top: 21px; }
.menu-open .menu-toggle span:first-child { top: 17.5px; transform: rotate(45deg); }
.menu-open .menu-toggle span:last-child { top: 17.5px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  overflow: hidden;
  background:
    radial-gradient(ellipse 60vmin 50vmin at 50% 42%, rgba(184, 134, 47, 0.09), transparent 70%),
    var(--ink);
}

/* Oversized ghost house, cropped off the bottom right (as the wallpapers) */
.ghost {
  position: absolute;
  width: 110vmin;
  height: 110vmin;
  right: -40vmin;
  bottom: -32vmin;
  color: var(--gold);
  stroke-width: 7;
  opacity: 0.05;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px var(--gutter) 48px;
  text-align: center;
}

/* The house draws itself in: roof, walls, door, then chimney */
.hero-mark {
  width: clamp(88px, 13vh, 150px);
  height: clamp(88px, 13vh, 150px);
  color: var(--gold);
}
.hero-mark .stroke {
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1;
  opacity: 0;
  animation: draw-in 520ms cubic-bezier(.6, 0, .2, 1) forwards;
}
.hero-mark .stroke:nth-child(1) { animation-delay: 200ms; }
.hero-mark .stroke:nth-child(2) { animation-delay: 420ms; }
.hero-mark .stroke:nth-child(3) { animation-delay: 640ms; }
.hero-mark .stroke:nth-child(4) { animation-delay: 820ms; animation-duration: 360ms; }
@keyframes draw-in {
  from { stroke-dashoffset: 1; opacity: 1; }
  to   { stroke-dashoffset: 0; opacity: 1; }
}

.hero-word {
  margin-top: clamp(22px, 3.4vh, 40px);
  font-size: clamp(28px, 4.6vh, 56px);
  font-weight: 500;
  letter-spacing: var(--track);
  margin-right: calc(-1 * var(--track));
  line-height: 1;
  opacity: 0;
  animation: settle 700ms ease-out 1150ms forwards;
}
@keyframes settle {
  from { opacity: 0; letter-spacing: 0.36em; margin-right: -0.36em; }
  to   { opacity: 1; letter-spacing: var(--track); margin-right: calc(-1 * var(--track)); }
}

.hero-after {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(28px, 4.6vh, 52px);
  opacity: 0;
  animation: rise 700ms var(--ease) 1500ms forwards;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.hero-tagline {
  max-width: 34em;
  font-size: clamp(16px, 1.9vh, 19px);
  line-height: 1.55;
  color: var(--body);
}

.hero-cta {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}
/* One button, as wide as the two-button row it replaced */
.hero-cta .btn { width: 374px; max-width: 100%; }

/* ---------- Sections ---------- */

.section { padding: clamp(64px, 8vw, 112px) 0; }
main { flex: 1; }

/* A page with one short section: centre it between the header and footer */
.page-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-text);
}

.section-title {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.section-lede {
  max-width: 36em;
  margin-top: 16px;
  font-size: 17px;
  color: var(--body);
}

/* ---------- Footer ---------- */

.footer {
  position: relative;
  overflow: hidden;
  padding: 72px 0 40px;
  border-top: 1px solid var(--rail);
  background: var(--ink-deep);
}
.ghost-footer {
  width: 600px;
  height: 600px;
  right: -200px;
  bottom: -260px;
  opacity: 0.045;
}

.footer-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 48px;
}
.footer-brand p {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, auto));
  gap: 48px;
}
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h2 {
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
}
.footer-col a {
  font-size: 14px;
  color: var(--body);
  transition: color 160ms ease;
}
.footer-col a:hover { color: var(--bone); }

.footer-bottom {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--rail);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ash);
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  :root { --nav-h: 60px; }

  .menu-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--ink);
    border-bottom: 1px solid var(--rail);
    font-size: 17px;
    color: var(--bone);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, transform 220ms var(--ease), visibility 0s linear 220ms;
  }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--rail); }
  .nav-links a[aria-current="page"] { color: var(--gold-text); }
  .nav-links a[aria-current="page"]::after { display: none; }
  .menu-open .nav-links {
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 180ms ease, transform 220ms var(--ease), visibility 0s;
  }

  .footer-top { flex-direction: column; }
}

@media (max-width: 640px) {
  .nav-inner { gap: 12px; }
  .brand { gap: 10px; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-word { font-size: 13px; }
  .menu-toggle { width: 36px; height: 36px; }
  .menu-toggle span { left: 10px; right: 10px; }
  .menu-toggle span:first-child { top: 13px; }
  .menu-toggle span:last-child { top: 20px; }
  .menu-open .menu-toggle span:first-child,
  .menu-open .menu-toggle span:last-child { top: 16.5px; }

  .hero-cta { align-self: stretch; }
  .hero-cta .btn { width: 100%; }

  .footer-cols { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-mark .stroke, .hero-word, .hero-after { animation: none; }
  .hero-mark .stroke { stroke-dashoffset: 0; opacity: 1; }
  .hero-word, .hero-after { opacity: 1; }
  .icon { transition: none; }
}
