/* agne.uk. Self-hosted fonts, no external requests. */
@font-face { font-family: "Instrument Serif"; src: url("/fonts/InstrumentSerif-Regular.woff2") format("woff2"); font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("/fonts/Caveat.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #141311;
  --text: #efe9dd;
  --dim: #a59f93;
  --line: #2b2925;
  --amber: #e2a54b;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --ease: cubic-bezier(0.16, 0.84, 0.24, 1);
  --max: 1080px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Paper grain over the whole page, so the dark background feels printed rather than flat. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; text-decoration-thickness: 1px; transition: color 0.3s, text-decoration-color 0.3s; }
a:hover { text-decoration-color: var(--amber); }

img { display: block; max-width: 100%; height: auto; }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: clamp(20px, 5vw, 40px); }

.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 26px; }
.brand img { width: 138px; height: auto; }
.top nav { display: flex; gap: clamp(18px, 4vw, 34px); }
.top nav a { color: var(--dim); text-decoration: none; }
.top nav a:hover { color: var(--text); }

/* Hero: the signature writes itself, then the headline and text rise in. */
.hero { padding-block: clamp(64px, 14vh, 150px) clamp(72px, 14vh, 150px); }
.signature { width: min(100%, 720px); margin-left: -0.6%; }
.signature svg { display: block; width: 100%; height: auto; overflow: visible; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 7.2vw, 5.5rem); line-height: 1; letter-spacing: -0.015em; margin: clamp(28px, 5vw, 48px) 0 24px; }
.hero p { font-size: clamp(1.1rem, 2.1vw, 1.3rem); color: var(--dim); max-width: 44ch; margin: 0; }

.js .signature .ink { clip-path: inset(-10% 100% -10% 0); animation: write 2.1s var(--ease) 0.25s forwards; }
.js .signature .line { stroke-dasharray: 1800; stroke-dashoffset: 1800; animation: draw 1s var(--ease) 1.55s forwards; }
@keyframes write { to { clip-path: inset(-10% -2% -10% 0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Scroll reveals: slow fade, rise, and unblur. --d sets an extra delay. */
.js .reveal { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity 1.2s var(--ease) var(--d, 0s), transform 1.2s var(--ease) var(--d, 0s), filter 1.2s var(--ease) var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; filter: none; }
.js .reveal.rise { transform: translateY(80px) scale(0.97); transition-duration: 1.6s; }
.js .reveal.rise.in { transform: none; }

/* Handwritten notes, like pencil marks in a margin. */
.note { font-family: var(--hand); font-weight: 500; font-size: 1.9rem; line-height: 1.2; color: var(--amber); margin: 0 0 18px; }
.note::after { content: " ↓"; }

.app { display: grid; grid-template-columns: 1fr minmax(220px, 310px); gap: clamp(40px, 8vw, 120px); align-items: center; padding-block: clamp(72px, 12vh, 128px); border-top: 1px solid var(--line); }
.app > * { min-width: 0; }
.app-icon { width: 72px; height: 72px; border-radius: 18px; }
.app h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(3.2rem, 8vw, 5.2rem); line-height: 1; letter-spacing: -0.01em; margin: 26px 0 20px; }
.app p { color: var(--dim); margin: 0 0 14px; max-width: 46ch; }
.app .lead { color: var(--text); font-size: 1.22rem; }
.meta { font-size: 0.9rem; }
.links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 28px !important; }
.links a { color: var(--text); font-weight: 500; text-decoration-color: var(--amber); }
.links a:hover { color: var(--amber); }
.phone-wrap { margin: 0; }
.phone { width: 100%; border-radius: 32px; border: 1px solid var(--line); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8); }

.ways { display: grid; grid-template-columns: minmax(180px, 0.42fr) 1fr; gap: clamp(24px, 5vw, 72px); align-items: start; padding-block: clamp(72px, 12vh, 128px); border-top: 1px solid var(--line); }
.ways .note { margin: 0; padding-top: 6px; }
.ways .note::after { content: " →"; }
.ways-list { display: grid; }
.ways-list > div { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 12px 40px; align-items: baseline; padding-block: 26px; border-top: 1px solid var(--line); }
.ways-list > div:first-child { border-top: 0; padding-top: 0; }
.ways h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 2.6vw, 2.1rem); line-height: 1.1; margin: 0; }
.ways p { color: var(--dim); margin: 0; }

.contact { padding-block: clamp(72px, 12vh, 136px); border-top: 1px solid var(--line); }
.hand { font-family: var(--hand); font-weight: 600; font-size: clamp(3.4rem, 9vw, 6rem); line-height: 1; margin: 0 0 24px; position: relative; display: inline-block; }
.scribble { position: absolute; left: 0; bottom: -0.18em; width: 100%; height: 0.4em; overflow: visible; }
.scribble path { fill: none; stroke: var(--amber); stroke-width: 5; stroke-linecap: round; }
.js .scribble path { stroke-dasharray: 260; stroke-dashoffset: 260; transition: stroke-dashoffset 1.1s var(--ease) 0.6s; }
.js .reveal.in .scribble path { stroke-dashoffset: 0; }
.contact p { color: var(--dim); max-width: 56ch; margin: 0; overflow-wrap: anywhere; font-size: 1.15rem; }
.contact a { color: var(--text); text-decoration-color: var(--amber); }

footer { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 28px 48px; border-top: 1px solid var(--line); color: var(--dim); font-size: 0.9rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

@media (max-width: 900px) {
  .ways { grid-template-columns: 1fr; }
  .ways .note { margin-bottom: 8px; }
  .ways .note::after { content: " ↓"; }
  .ways-list > div { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .phone-wrap { max-width: 280px; }
  .brand img { width: 118px; }
}

/* No motion for people who ask for less: everything shows in its final place. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .signature .ink, .js .signature .line { animation: none; clip-path: none; stroke-dashoffset: 0; }
  .js .reveal, .js .reveal.rise { opacity: 1; transform: none; filter: none; transition: none; }
  .js .scribble path { stroke-dashoffset: 0; transition: none; }
  a { transition: none; }
}
