/* site.css — aelor research
   Layout: a full-bleed painted hero; one centred column rests on the painting's
   calm cream field, navigation floats on a soft ivory veil. */

:root {
  --ivory: #f5efe3;          /* page ground, the painting's own cream */
  --paper: #fbf8f1;
  --ink: #0f2438;            /* Prussian ink */
  --prussian: #173b5c;       /* Prussian blue */
  --prussian-deep: #0b2135;
  --solar: #cf6d27;          /* warm solar orange, used as a hairline accent */
  --slate: #3a4b5e;          /* secondary text */
  --rule: rgba(15, 36, 56, 0.16);
  --wash-rgb: 248 243 233;   /* readability wash, matches the shader */
  --wash: 0.5;
  --font-display: "Cormorant", "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --font-text: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 3rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--solar); outline-offset: 3px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 34rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  isolation: isolate;
  container: hero / size;
  background: var(--ivory);
}

/* Layers, back to front: static painting (fallback), WebGL canvas, CSS wash (fallback).
   With JavaScript the hero opens on ivory and the canvas paints the entrance;
   the still painting only appears when the animation cannot run. */
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__still {
  position: absolute; inset: 0;
  background: var(--focus, 52% 42%) / cover no-repeat;   /* image attached only when shown */
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.hero__wash {
  position: absolute; inset: 0;
  background: radial-gradient(50% 50% at 50% var(--calm-y, 47%),
    rgb(var(--wash-rgb) / var(--wash)) 12%,
    rgb(var(--wash-rgb) / calc(var(--wash) * 0.86)) 30%,
    rgb(var(--wash-rgb) / calc(var(--wash) * 0.51)) 50%,
    rgb(var(--wash-rgb) / calc(var(--wash) * 0.19)) 70%,
    rgb(var(--wash-rgb) / calc(var(--wash) * 0.1)) 84%);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero.is-static .hero__still,
.aelor-static .hero__still { background-image: url("../assets/painting.jpg"); }
.hero.is-static .hero__still,
.aelor-static .hero__still,
.hero.is-static .hero__wash,
.aelor-static .hero__wash { opacity: 1; }
.hero.is-live .hero__canvas { opacity: 1; }
.hero.is-live .hero__wash { opacity: 0; }   /* the shader draws its own wash */
.hero.is-inspecting .hero__content,
.hero.is-inspecting .nav { opacity: 0.22; }

/* soft ivory veil so the navigation reads over the painted corners */
.hero::before {
  content: "";
  position: absolute; inset: 0 0 auto;
  height: clamp(5.5rem, 17cqh, 9rem);
  pointer-events: none;
  background:
    radial-gradient(42% 130% at 0% 0%, rgb(var(--wash-rgb) / 0.9), rgb(var(--wash-rgb) / 0) 72%),
    radial-gradient(52% 120% at 100% 0%, rgb(var(--wash-rgb) / 0.82), rgb(var(--wash-rgb) / 0) 70%),
    linear-gradient(to bottom, rgb(var(--wash-rgb) / 0.42), rgb(var(--wash-rgb) / 0));
}

/* ------------------------------------------------------------------ nav */

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: clamp(1rem, 3.2cqh, 1.9rem);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}
.brand__name {
  font: 500 1.7rem/1 var(--font-display);
  letter-spacing: -0.01em;
}
.brand__suffix {
  font: 600 0.64rem/1 var(--font-text);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.6cqw, 2.4rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__links a {
  display: inline-block;
  padding-block: 0.35rem;
  font: 500 0.86rem/1 var(--font-text);
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(var(--solar), var(--solar)) 0 100% / 0 1px no-repeat;
  transition: background-size 0.35s ease;
}
.nav__links a:hover { background-size: 100% 1px; }
.nav__links .nav__contact {
  padding: 0.6rem 0.95rem;
  border: 1px solid var(--rule);
  background: rgb(var(--wash-rgb) / 0.5);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.nav__links .nav__contact:hover { border-color: var(--prussian); background-color: rgb(var(--wash-rgb) / 0.85); }

/* ------------------------------------------------------------------ hero copy */

.hero__content {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 50rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: 8cqh;            /* sits slightly above centre, on the cream field */
  text-align: center;
}
.hero__mark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(4.4rem, min(17cqw, 28cqh), 12.5rem);
  line-height: 0.8;
  letter-spacing: -0.045em;
  color: var(--ink);
  text-shadow: 0 0 2.4rem rgb(var(--wash-rgb) / 0.7);
}
.hero__title {
  margin: clamp(1rem, 3cqh, 1.7rem) 0 0;
  font: italic 500 clamp(1.3rem, min(2.5cqw, 4.4cqh), 2.05rem)/1.25 var(--font-display);
  color: var(--prussian);
  text-wrap: balance;
  text-shadow: 0 0 1.2rem rgb(var(--wash-rgb) / 0.9);
}
.hero__lede {
  margin: 0.75rem 0 0;
  max-width: 31rem;
  font-size: clamp(0.98rem, min(1.25cqw, 2.4cqh), 1.1rem);
  line-height: 1.6;
  color: var(--slate);
  text-wrap: balance;
  text-shadow: 0 0 1rem rgb(var(--wash-rgb) / 0.95);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: clamp(1.5rem, 4.5cqh, 2.5rem);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 2.95rem;
  padding: 0 1.4rem;
  border: 1px solid var(--prussian);
  border-radius: 2px;
  font: 500 0.9rem/1 var(--font-text);
  letter-spacing: 0.015em;
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn--primary { background: var(--prussian); color: var(--paper); }
.btn--primary:hover { background: var(--prussian-deep); border-color: var(--prussian-deep); }
.btn--ghost {
  background: rgb(var(--wash-rgb) / 0.62);
  color: var(--prussian);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.btn--ghost:hover { background: rgb(var(--wash-rgb) / 0.92); }
.btn__arrow { display: inline-block; transition: transform 0.3s ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }

@container hero (max-width: 760px) {
  .nav__links li:not(:last-child) { display: none; }
  .brand__name { font-size: 1.5rem; }
}
@container hero (max-width: 520px) {
  .hero__mark { font-size: clamp(4.2rem, 27cqw, 7rem); }
  .hero__title { font-size: 1.32rem; }
  .hero__lede { font-size: 0.97rem; max-width: 22rem; }
  .hero__content { padding-bottom: 6cqh; }
  .btn { min-height: 2.8rem; padding: 0 1.1rem; }
}

/* ------------------------------------------------------------------ research areas */

.areas {
  padding-block: clamp(4.5rem, 10vw, 8rem);
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.areas__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr);
  gap: clamp(2rem, 6vw, 5.5rem);
}
.areas__head h2 {
  margin: 0;
  font: 500 clamp(2.3rem, 4.2vw, 3.3rem)/1 var(--font-display);
  letter-spacing: -0.01em;
}
.areas__head p {
  margin: 1rem 0 0;
  max-width: 22rem;
  color: var(--slate);
}
.areas__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.area {
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
}
.area h3 {
  margin: 0;
  font: 500 1.45rem/1.15 var(--font-display);
  text-wrap: balance;
}
.area p {
  margin: 0.7rem 0 0;
  font-size: 0.95rem;
  color: var(--slate);
}
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.75rem 2.25rem;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  border-top: 1px solid var(--rule);
  font: 400 0.78rem/1.5 var(--font-mono);
  color: var(--slate);
}
.foot a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot a:hover { border-bottom-color: var(--solar); }

@media (max-width: 860px) {
  .areas__inner, .areas__list { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ entrance */

@media (prefers-reduced-motion: no-preference) {
  .nav { animation: aelor-fade 1.2s ease 0.9s both; }
  .hero__content > * { animation: aelor-rise 1.1s cubic-bezier(0.2, 0.65, 0.2, 1) both; }
  .hero__mark { animation-delay: 0.25s; }
  .hero__title { animation-delay: 0.5s; }
  .hero__lede { animation-delay: 0.62s; }
  .hero__actions { animation-delay: 0.78s; }
}
@keyframes aelor-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes aelor-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__still, .hero__canvas, .hero__wash, .btn, .btn__arrow, .nav__links a { transition: none; }
}
