@font-face {
  font-family: "Anybody";
  src: url(fonts/anybody.woff2) format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url(fonts/source-serif-4.woff2) format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

/* The page is one dawn: night at the top, morning at the bottom. */
:root {
  --night: #141d3b;
  --predawn: #1f2650;
  --dawn: #3a2346;
  --sunrise: #f0b54a;
  --morning: #eef0ec;
  --rice: #f3eee3;
  --turmeric: #f0b54a;
  --deep-ink: #1b2138;

  --display: "Anybody", "Arial Narrow", sans-serif;
  --text: "Source Serif 4", Georgia, serif;
  --measure: 38rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--rice);
  font: 400 1.125rem/1.7 var(--text);
  text-rendering: optimizeLegibility;
}
/* Fine grain, like the ground a kolam is drawn on. */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

h1, h2, h3, p, ol, dl, dd, figure { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus, var(--turmeric)); outline-offset: 4px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--rice); color: var(--night); padding: .5rem 1rem;
}
.skip:focus { top: 1rem; }

/* Skies. Each section fades in from the colour above it. */
.sky-night   { --sky: var(--night);   --from: var(--night); }
.sky-predawn { --sky: var(--predawn); --from: var(--night); }
.sky-dawn    { --sky: var(--dawn);    --from: var(--predawn); }
.sky-sunrise { --sky: var(--sunrise); --from: var(--dawn);    color: var(--deep-ink); --focus: var(--deep-ink); }
.sky-morning { --sky: var(--morning); --from: var(--morning); color: var(--deep-ink); --focus: var(--deep-ink); }
#approach    { --from: var(--sunrise); }
section, footer, .hero {
  background: linear-gradient(to bottom, var(--from) 0, var(--sky) 12rem, var(--sky) 100%);
}
/* Plum to gold passes through the rose of first light rather than muddy brown. */
.sky-sunrise {
  background: linear-gradient(to bottom, var(--dawn) 0, #9c4a62 5rem, #e0875a 9rem, var(--sky) 14rem, var(--sky) 100%);
}

.wrap { max-width: 78rem; margin: 0 auto; padding: 12rem var(--gutter) 7rem; }

h2 {
  font: 700 clamp(2rem, 10vw, 4.75rem)/1 var(--display);
  font-stretch: 125%;
  letter-spacing: -.01em;
  margin-bottom: 1.25rem;
}
h3 {
  font: 650 1.45rem/1.2 var(--display);
  font-stretch: 105%;
  margin-bottom: .5rem;
}
.intro { max-width: var(--measure); opacity: .8; }

/* Hero */
.hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; overflow: clip; }
.top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .85rem var(--gutter);
  font: 500 .95rem/1 var(--display);
  font-stretch: 110%;
}
.top ul { display: flex; gap: clamp(1rem, 3vw, 2.25rem); margin: 0; padding: 0; list-style: none; }
.top a { text-decoration: none; opacity: .85; display: inline-block; padding: .65rem 0; }
.top a:hover { opacity: 1; text-decoration: underline; }
.top .home { opacity: 1; }

.hero-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 2rem var(--gutter) 4rem;
  max-width: 88rem; width: 100%; margin: 0 auto;
}
.hero-text { container-type: inline-size; }
/* Sized to the column, so the surname always fits on one line. */
.name {
  font: 800 min(8rem, 11.4cqi)/.92 var(--display);
  font-stretch: 118%;
  letter-spacing: -.015em;
  margin-bottom: 2rem;
}
.name span { display: block; }
.role {
  font: 600 1.25rem/1.35 var(--display);
  font-stretch: 108%;
  color: var(--turmeric);
  margin-bottom: 1rem;
}
.lead { max-width: 34rem; font-size: 1.2rem; opacity: .9; }
.hero-contact { margin-top: 1.5rem; font: 600 1.15rem/1 var(--display); font-stretch: 110%; }
.hero-contact .cta {
  display: inline-block; padding: .95rem 1.6rem; border-radius: 999px;
  background: var(--turmeric); color: var(--night); text-decoration: none;
  font: 700 1.1rem/1 var(--display); font-stretch: 112%;
  transition: background-color .2s, transform .2s;
}
.hero-contact .cta:hover { background: #f5c566; transform: translateY(-1px); }

.hero-kolam { display: grid; gap: 1.25rem; justify-items: center; }
.hero-kolam figcaption { max-width: 26rem; text-align: center; font-size: .95rem; line-height: 1.55; opacity: .85; }
.redraw {
  margin-top: 1rem;
  font: 600 .95rem/1 var(--display); font-stretch: 110%;
  color: var(--rice); background: transparent;
  border: 1px solid color-mix(in srgb, var(--rice) 45%, transparent);
  border-radius: 999px; padding: .75rem 1.3rem; cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.redraw:hover { border-color: var(--turmeric); background: color-mix(in srgb, var(--turmeric) 12%, transparent); }

/* Kolam canvases: the drawing, with a separate layer for the moving light. */
.kolam { position: relative; aspect-ratio: 1; width: 100%; --grain: var(--rice); --spark: var(--turmeric); }
.kolam canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.kolam canvas:first-child { transition: opacity .45s ease; }
.kolam.clearing canvas:first-child { opacity: 0; }
.hero .kolam { max-width: min(34rem, 80vh); }
/* A lamp at the threshold: warm light pooled behind the kolam. */
.hero .kolam::before {
  content: ""; position: absolute; inset: -18%;
  background: radial-gradient(closest-side, rgb(240 181 74 / .16), rgb(224 135 90 / .07) 55%, transparent);
  pointer-events: none;
}

/* Selected work */
.projects { margin-top: 5rem; display: grid; gap: clamp(3.5rem, 7vw, 6rem); }
.project-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  column-gap: clamp(1rem, 4vw, 4rem);
  align-items: start;
}
.project h3 { grid-row: 1 / span 2; font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-stretch: 115%; line-height: 1.05; margin: 0; }
.project p { grid-column: 2; }
.project p { max-width: var(--measure); opacity: .85; }
.project .outcome { margin-top: .75rem; color: var(--turmeric); opacity: 1; font-weight: 600; }
.project .stack {
  margin-top: .9rem; opacity: .7;
  font: 500 .95rem/1.4 var(--display); font-stretch: 105%;
}

/* What I do */
.services { margin-top: 4rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3.5rem clamp(2rem, 6vw, 6rem); }
.services dt { font: 700 clamp(1.6rem, 3vw, 2.3rem)/1.1 var(--display); font-stretch: 115%; margin-bottom: .6rem; }
.services dd { max-width: 30rem; opacity: .85; }
.tools-title { margin-top: 6rem; font-size: clamp(1.6rem, 3vw, 2.3rem); font-stretch: 115%; }
.tools { margin-top: 1.5rem; }
.tools div {
  display: grid; grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr); gap: 2rem;
  padding: 1.1rem 0; border-top: 1px solid color-mix(in srgb, var(--rice) 22%, transparent);
}
.tools dt { font: 700 1.15rem/1.4 var(--display); font-stretch: 110%; color: var(--turmeric); }
.tools dd { opacity: .88; }

/* Background */
.timeline { margin-top: 4rem; }
.timeline li {
  display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 2rem;
  padding: 2rem 0; border-top: 1.5px solid color-mix(in srgb, var(--deep-ink) 30%, transparent);
}
.timeline .years { font: 700 clamp(1.4rem, 2.6vw, 2rem)/1.1 var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.timeline p { max-width: var(--measure); }
.aside { margin-top: 3rem; font-weight: 600; }

/* How I work */
#approach .wrap { padding-bottom: 3rem; }
.steps { margin-top: 4rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem; counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block; margin-bottom: 1rem;
  font: 800 4.5rem/1 var(--display); font-stretch: 130%;
  color: #b0660c;
}
.steps p { color: #3d4358; }

/* Contact */
.contact { container-type: inline-size; padding-top: 7rem; }
.contact-note { max-width: var(--measure); color: #3d4358; font-size: 1.2rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The enquiry assistant */
.assistant {
  max-width: 46rem; margin-top: 3rem;
  background: #fbfbf8; border: 1.5px solid color-mix(in srgb, var(--deep-ink) 22%, transparent);
  border-radius: 1.25rem; box-shadow: 0 1.5rem 3rem -2rem rgb(27 33 56 / .35);
  overflow: hidden;
}
.log {
  display: flex; flex-direction: column; gap: .75rem;
  max-height: min(28rem, 60vh); min-height: 9rem; overflow-y: auto;
  padding: 1.5rem 1.5rem 1rem; overscroll-behavior: contain;
}
.msg { max-width: 85%; padding: .7rem 1rem; border-radius: 1rem; font-size: 1.02rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot { align-self: flex-start; background: #eef0ec; border-bottom-left-radius: .3rem; }
.msg.me { align-self: flex-end; background: var(--deep-ink); color: var(--rice); border-bottom-right-radius: .3rem; }
.msg.note { align-self: center; max-width: 100%; background: none; color: #8a4600; font-size: .95rem; text-align: center; }
.msg.typing { display: flex; gap: .35rem; padding: 1rem 1.1rem; }
.msg.typing span { width: .45rem; height: .45rem; border-radius: 50%; background: #b0660c; animation: blink 1.2s infinite ease-in-out; }
.msg.typing span:nth-child(2) { animation-delay: .15s; }
.msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.compose[hidden] { display: none; }
.compose { display: flex; gap: .75rem; align-items: flex-end; padding: 1rem 1.25rem; border-top: 1px solid #dfe2dc; }
.compose textarea {
  flex: 1; resize: none; min-height: 2.9rem; max-height: 9rem;
  font: inherit; font-size: 1rem; line-height: 1.45; color: var(--deep-ink);
  background: #fff; border: 1.5px solid #c9cdc4; border-radius: .8rem; padding: .7rem .9rem;
}
.compose textarea:focus-visible { outline: 2px solid var(--deep-ink); outline-offset: 1px; border-color: var(--deep-ink); }
.compose button {
  font: 650 1rem/1 var(--display); font-stretch: 110%;
  background: var(--deep-ink); color: var(--rice); border: 0; border-radius: .8rem;
  padding: 0 1.3rem; height: 2.9rem; cursor: pointer;
}
.compose button:hover { background: #2c3558; }
.compose button:disabled { opacity: .5; cursor: default; }
.privacy { padding: 0 1.25rem 1rem; font-size: .85rem; line-height: 1.5; color: #555b6e; }
.or { margin-top: 3rem; color: #3d4358; font-size: 1.15rem; }
.or a { color: var(--deep-ink); font-weight: 600; }

/* The "Send me a message" popup */
.message-dialog {
  width: min(34rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem);
  padding: 0; border: 0; border-radius: 1.4rem;
  background: #fbfbf8; color: var(--deep-ink);
  box-shadow: 0 2rem 4rem -1rem rgb(10 14 30 / .55);
}
.message-dialog::backdrop { background: rgb(20 29 59 / .6); backdrop-filter: blur(3px); }
.dialog-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.4rem 1.5rem 1.1rem; background: var(--night); color: var(--rice);
}
.dialog-head h2 { margin: 0; font-size: 1.6rem; font-stretch: 115%; }
.dialog-close {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; margin-right: -.4rem;
  color: var(--rice); background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
.dialog-close:hover { background: rgb(243 238 227 / .12); }
.fields { display: grid; gap: 1rem; padding: 1.4rem 1.5rem .5rem; }
.fields label { display: grid; gap: .35rem; font: 600 .95rem/1.2 var(--display); font-stretch: 105%; color: #3d4358; }
.fields input, .fields textarea {
  font: 400 1rem/1.45 var(--text); color: var(--deep-ink);
  background: #fff; border: 1.5px solid #c9cdc4; border-radius: .7rem; padding: .7rem .85rem; width: 100%;
}
.fields textarea { resize: vertical; min-height: 8rem; }
.fields input:focus-visible, .fields textarea:focus-visible { outline: 2px solid var(--deep-ink); outline-offset: 1px; border-color: var(--deep-ink); }
.fields .trap { position: absolute; left: -9999px; }
.form-error { padding: 0 1.5rem; color: #a13d1c; font-size: .95rem; }
.form-error:empty { display: none; }
.dialog-foot { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem 1.5rem 1.4rem; }
.dialog-foot .privacy { padding: 0; }
.message-dialog .send {
  flex: none; font: 650 1rem/1 var(--display); font-stretch: 110%;
  background: var(--deep-ink); color: var(--rice); border: 0; border-radius: .8rem;
  padding: 0 1.3rem; height: 2.9rem; cursor: pointer;
}
.message-dialog .send:hover { background: #2c3558; }
.message-dialog .send:disabled { opacity: .55; cursor: default; }
.sent { display: grid; justify-items: center; gap: .75rem; padding: 2.5rem 1.75rem 2rem; text-align: center; }
.sent[hidden] { display: none; }
.sent h2 { margin: .5rem 0 0; font-size: 1.8rem; font-stretch: 115%; }
.sent-note { max-width: 24rem; color: #3d4358; }
.sent .send { margin-top: 1rem; }
footer p { max-width: 78rem; margin: 0 auto; padding: 2rem var(--gutter) 3rem; font-size: .9rem; color: #3d4358; }

/* Load moment: the name widens into place while the first kolam is drawn. */
@media (prefers-reduced-motion: no-preference) {
  .message-dialog[open] { animation: pop .35s cubic-bezier(.2, .8, .2, 1); }
  .message-dialog[open]::backdrop { animation: fade .35s ease; }
  @keyframes pop { from { opacity: 0; transform: translateY(1rem) scale(.97); } }
  @keyframes fade { from { opacity: 0; } }
  .name span { animation: widen 1.6s cubic-bezier(.2, .7, .1, 1) both; }
  .name span + span { animation-delay: .18s; }
  .role, .lead, .hero-contact { animation: rise 1.2s .6s cubic-bezier(.2, .7, .1, 1) both; }
  @keyframes widen { from { font-stretch: 50%; opacity: 0; letter-spacing: .08em; } }
  @keyframes rise { from { opacity: 0; transform: translateY(.75rem); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .msg.typing span { animation: none; opacity: .6; }
  .kolam canvas:first-child { transition: none; }
}

@media (max-width: 860px) {
  .hero-body { grid-template-columns: 1fr; padding-top: 1rem; }
  .hero { min-height: 0; }
  .hero .kolam { max-width: min(26rem, 82vw); }
  .wrap { padding-top: 7rem; padding-bottom: 5rem; }
  .project-text { grid-template-columns: 1fr; }
  .project h3 { grid-row: auto; margin-bottom: .75rem; }
  .project p { grid-column: 1; }
  .services { grid-template-columns: 1fr; gap: 2.5rem; }
  .tools div { grid-template-columns: 1fr; gap: .25rem; }
  .log { padding: 1rem; }
  .msg { max-width: 92%; }
  .compose { padding: .85rem; gap: .5rem; }
  .compose button { padding: 0 1rem; }
  .dialog-head h2 { font-size: 1.3rem; }
  .dialog-foot { flex-direction: column-reverse; align-items: stretch; }
  .dialog-foot .send { width: 100%; }
  .timeline li { grid-template-columns: 1fr; gap: .5rem; }
  .steps { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 480px) {
  .top ul { gap: .9rem; }
  .top .home { display: none; }
}
