/* Inter and Newsreader (SIL Open Font License), self-hosted, Latin subsets. */
@font-face {
  font-family: "Inter";
  src: url("resources/fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("resources/fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

/* =========================================================
   1. TOKENS — tweak the look here first.
   ========================================================= */
:root {
  /* Colour — dark theme, green accent */
  color-scheme: dark;
  --color-bg:        #232a27;
  --color-surface:   #2b3330;
  --color-text:      #e8ebe9;
  --color-muted:     #9aa49f;
  --color-border:    #3d4642;
  --color-accent:    #6cc3a3;   /* soft green */
  --color-accent-hover: #8fd5bb;
  --color-on-accent: #0f1a16;
  --color-heading:   #a9dcc8;   /* pale green tint */
  --color-name:      #c8ecdd;

  /* Type */
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Newsreader", Georgia, "Times New Roman", serif;  /* name and "Get in touch" */
  --text-sm:   0.875rem;
  --text-base: 1.0625rem;
  --text-lg:   1.25rem;
  --text-xl:   clamp(1.75rem, 1.4rem + 1.5vw, 2.25rem);
  --text-2xl:  clamp(2.5rem, 1.8rem + 3vw, 4rem);
  --measure:   65ch;
  --leading:   1.65;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 6rem;

  /* Shape & layout */
  --radius-sm: 6px;
  --radius-lg: 20px;
  --shadow:    0 12px 40px -12px rgb(0 0 0 / 0.6);
  --page-width: 68rem;
  --gutter:     clamp(1rem, 4vw, 2rem);
  --photo-width: 18rem;
}

/* =========================================================
   2. BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }  /* components set display, which would override it */

h1, h2 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 var(--space-3);
}
h1 { font-size: var(--text-2xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-xl); }

p { margin: 0 0 var(--space-3); }

a { color: var(--color-accent); }
a:hover { color: var(--color-accent-hover); }

/* Text links: faint resting underline, a full one draws in from the left on hover. */
a:not(.button) {
  text-decoration: none;
  padding-bottom: 1px;
  background:
    linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat,
    linear-gradient(rgb(108 195 163 / 0.35), rgb(108 195 163 / 0.35)) 0 100% / 100% 1px no-repeat;
  transition: background-size 0.25s ease;
}
a:not(.button):hover { background-size: 100% 1px, 100% 1px; }

::selection { background: var(--color-accent); color: var(--color-on-accent); }

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

/* =========================================================
   3. LAYOUT
   ========================================================= */
.page {
  max-width: var(--page-width);
  margin-inline: auto;
  padding: var(--space-6) var(--gutter);
  display: grid;
  gap: var(--space-7);
}

/* =========================================================
   4. COMPONENTS
   ========================================================= */

/* Intro */
/* Name sits in its own row above the photo, so the right column lines up with the photo's top. */
.columns {
  display: grid;
  gap: var(--space-4) var(--space-6);
  align-items: start;
}
@media (min-width: 48rem) {
  .columns { grid-template-columns: var(--photo-width) 1fr; }
  .intro { grid-column: 1; grid-row: 2; }
  .about { grid-column: 2; grid-row: 2; }
}
.name { margin: 0; color: var(--color-name); font-size: clamp(2rem, 1.6rem + 2vw, 2.6rem); font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; }
.tagline { margin: var(--space-1) 0 0; color: var(--color-accent); font-weight: 500; letter-spacing: 0.01em; }

.intro {
  display: grid;
  gap: var(--space-4);
}

.intro__photo { margin: 0; }
.intro__photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 30%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  filter: brightness(0.85);
}


.eyebrow {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.lead { font-size: var(--text-lg); }
.intro__text p:not(.lead, .eyebrow) { color: var(--color-muted); }
.intro__text .button { margin-top: var(--space-3); }
/* A quiet card, same surface and edge as the contact box. */
.intro__text {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
}
.intro__text > :last-child { margin-bottom: 0; }

/* Button */
.button {
  display: inline-block;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.button:hover { background: var(--color-accent-hover); color: var(--color-on-accent); }
.button:active { transform: translateY(1px); }

/* Contact */
.contact {
  max-width: 40rem;
  width: 100%;
  margin-inline: auto;
  padding: var(--space-5) var(--gutter);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.contact > p { color: var(--color-muted); }

/* Form */
.form { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.field { display: grid; gap: var(--space-2); }
.field label { font-size: var(--text-sm); font-weight: 600; }
.field input,
.field textarea {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: inherit;
  font: inherit;
}
.field textarea { resize: vertical; }
.field input:focus-visible,
.field textarea:focus-visible { outline-offset: 0; border-color: var(--color-accent); }
.form .button { justify-self: start; }

/* Footer */
.footer {
  padding: var(--space-5) var(--gutter);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* Cursor glow — position set by the script in index.html */
@media (hover: hover) and (pointer: fine) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
      600px circle at var(--glow-x, 50%) var(--glow-y, 50%),
      rgb(108 195 163 / 0.09),
      transparent 80%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  body.has-glow::before { opacity: 1; }
}

/* Sections fade in once when scrolled into view (script.js adds .is-visible).
   index.html drops the .js class if script.js fails to load, so nothing stays hidden. */
.js .reveal:not(.is-visible) { opacity: 0; transform: translateY(12px); }
.js .reveal { transition: opacity 0.6s ease, transform 0.6s ease; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .js .reveal:not(.is-visible) { opacity: 1; transform: none; }
}

/* Contact form extras */
/* Honeypot: off-screen so people never fill it; bots do (see server/contact.py). */
.field--extra { position: absolute; left: -9999px; }
.form__status { margin: 0; color: var(--color-muted); }
.form__status:empty { display: none; }

/* About sections */
/* Section titles: small, spaced capitals, so the name and "Get in touch" carry the display font. */
.intro__text h2,
.about h2 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.lead { max-width: var(--measure); }
.about { display: grid; gap: var(--space-5); }
.about > section + section { padding-top: var(--space-5); border-top: 1px solid var(--color-border); }
.about p, .about li { max-width: var(--measure); }
.about ul { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-2); }
