/* Gabiche: night-desk palette taken from the ice-blue logo and the portrait's laptop glow */

@font-face {
  font-family: "Unbounded";
  src: url("/assets/fonts/unbounded-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --night: #030b1c;      /* logo background */
  --deep: #081733;       /* raised surfaces */
  --ink: #eaf2ff;        /* main text */
  --mist: #9aaccb;       /* secondary text */
  --line: rgba(154, 172, 203, 0.2);
  --frost: #e1f5ff;      /* logo highlight */
  --ice: #9ad1f4;        /* logo mid-tone, main accent */
  --steel: #3b7dba;      /* logo shading */
  --glow: linear-gradient(100deg, var(--frost), var(--ice) 55%, #6fb3e2);

  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--ice) 70%, transparent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ice); }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.12; }
h1, h2 { font-family: var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0 0 1em; text-wrap: pretty; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--ink); color: var(--night); padding: 0.6rem 1rem; border-radius: 8px;
}
.skip:focus { top: 1rem; }

/* Header */
.site-header { position: relative; z-index: 3; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand img { height: 2.4rem; width: auto; flex: none; }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.04em; }
.site-nav { display: flex; gap: clamp(0.9rem, 3vw, 2rem); font-size: 0.98rem; }
.site-nav a { text-decoration: none; color: var(--mist); padding-block: 0.4rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 30rem) {
  .brand__name { display: none; }
}

/* Buttons and sign-up form */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.4rem; padding: 0 1.5rem;
  border: 0; border-radius: var(--radius);
  background: var(--glow); color: #04122b;
  font: 650 1.02rem/1 var(--font-text);
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 10px 34px -10px rgba(154, 209, 244, 0.55);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.button:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 14px 44px -8px rgba(111, 179, 226, 0.75); }
.button:active { transform: translateY(1px); }

.signup { max-width: 34rem; }
.signup__row { display: flex; gap: 0.6rem; }
.signup__input {
  flex: 1; min-width: 0; min-height: 3.4rem; padding: 0 1rem;
  border: 1px solid rgba(154, 172, 203, 0.38); border-radius: var(--radius);
  background: rgba(3, 11, 28, 0.6); color: var(--ink);
  font: 400 1.02rem var(--font-text);
}
.signup__input::placeholder { color: #6f82a3; }
.signup__input:focus { outline: none; border-color: var(--ice); box-shadow: 0 0 0 3px rgba(154, 209, 244, 0.22); }
.signup__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.signup__note { margin: 0.75rem 0 0; font-size: 0.86rem; color: var(--mist); }
.signup__note a { color: var(--mist); }
@media (max-width: 34rem) {
  .signup__row { flex-direction: column; }
  .button { width: 100%; }
}

/* Hero: the portrait is the one loud element on the page */
.hero { position: relative; isolation: isolate; overflow: hidden; margin-top: -4.6rem; padding-top: 4.6rem; }
.hero__photo { position: absolute; inset: 0 0 0 auto; width: min(62%, 60rem); z-index: -1; }
.hero__photo picture, .hero__photo img { width: 100%; height: 100%; }
.hero__photo img {
  object-fit: cover; object-position: 50% 30%;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 32%), linear-gradient(to top, transparent 0, #000 22%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 32%), linear-gradient(to top, transparent 0, #000 22%);
  mask-composite: intersect;
  animation: wake 1.6s ease-out both;
}
@keyframes wake {
  from { opacity: 0; filter: brightness(0.55) saturate(0.8); }
  to   { opacity: 1; filter: none; }
}
@media (prefers-reduced-motion: reduce) { .hero__photo img { animation: none; } }

.hero__inner { min-height: min(46rem, 88vh); display: flex; align-items: center; padding-block: 4rem 5rem; }
.hero__copy { max-width: 32rem; }
.hero h1 { margin-bottom: 1.4rem; }
.hero__lede { font-size: 1.15rem; color: #c9d6ee; max-width: 30rem; margin-bottom: 2rem; }

@media (max-width: 56rem) {
  .hero { margin-top: -4.6rem; padding-top: 0; }
  .hero__photo { position: relative; width: 100%; aspect-ratio: 4 / 3.4; max-height: 72vh; }
  .hero__photo img {
    object-position: 50% 25%;
    -webkit-mask-image: linear-gradient(to top, transparent 0, #000 35%);
    mask-image: linear-gradient(to top, transparent 0, #000 35%);
  }
  .hero__inner { min-height: 0; margin-top: -3.2rem; padding-block: 0 4rem; position: relative; }
}

/* Course */
.course { padding-block: clamp(4rem, 9vw, 7rem); border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--deep), var(--night) 70%); }
.course__inner {
  display: grid; gap: 2.5rem clamp(2rem, 6vw, 5rem);
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "intro days" "signup days";
  align-items: start;
}
.course__intro { grid-area: intro; }
.course__intro h2 { margin-bottom: 1.1rem; }
.course__intro p { color: #c9d6ee; max-width: 30rem; }
.course__fine { color: var(--mist) !important; font-size: 0.95rem; }
.course__signup { grid-area: signup; }
.days { grid-area: days; list-style: none; margin: 0; padding: 0; }
.days li {
  display: grid; grid-template-columns: 3.4rem 1fr; gap: 1rem;
  padding-block: 1.4rem; border-top: 1px solid var(--line);
}
.days li:last-child { border-bottom: 1px solid var(--line); }
.days__n {
  font-family: var(--font-display); font-weight: 300; font-size: 2.2rem; line-height: 1;
  background: var(--glow); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.days h3 { margin-bottom: 0.35rem; }
.days p { margin: 0; color: var(--mist); }
@media (max-width: 56rem) {
  .course__inner { grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: "intro" "days" "signup"; }
}

/* About */
.about { padding-block: clamp(4rem, 9vw, 7rem); }
.about__inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem clamp(2rem, 6vw, 5rem); }
.about__text { max-width: 38rem; font-size: 1.1rem; }
.about__text p:not(:last-child) { color: #c9d6ee; }
@media (max-width: 56rem) { .about__inner { grid-template-columns: 1fr; } }

/* Post lists */
.latest { padding-block: 0 clamp(4rem, 9vw, 7rem); }
.latest__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.latest__head a { color: var(--mist); }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding-block: 1.5rem; border-top: 1px solid var(--line); display: grid; grid-template-columns: 11rem 1fr; gap: 0.3rem 2rem; }
.post-list li:last-child { border-bottom: 1px solid var(--line); }
.post-list time { color: var(--mist); font-size: 0.92rem; padding-top: 0.15rem; grid-row: span 2; }
.post-list h3 { font-size: 1.3rem; }
.post-list h3 a { text-decoration: none; }
.post-list h3 a:hover { text-decoration: underline; }
.post-list p { margin: 0; color: var(--mist); max-width: 44rem; }
.post-list__empty { color: var(--mist); border-top: 1px solid var(--line); padding-top: 1.5rem; }
@media (max-width: 40rem) {
  .post-list li { grid-template-columns: 1fr; }
  .post-list time { grid-row: auto; }
}

/* Generic pages */
.page { padding-block: clamp(3rem, 8vw, 6rem); }
.page__header { margin-bottom: 2.5rem; max-width: 44rem; }
.page__header h1 { margin-bottom: 1rem; }
.page__lede { font-size: 1.15rem; color: #c9d6ee; }
.page__links a { color: var(--mist); font-size: 0.95rem; }
.status-page { min-height: 55vh; max-width: 40rem; margin-inline: auto; }
.status-page h1 { margin-bottom: 1rem; }
.status-page__tips { color: var(--mist); padding-left: 1.1rem; margin-bottom: 2rem; }

/* Long-form text */
.prose { max-width: 42rem; font-size: 1.125rem; line-height: 1.72; }
.prose h2 { font-size: clamp(1.25rem, 2.2vw, 1.5rem); margin: 2.4rem 0 0.8rem; }
.prose h3 { margin: 1.8rem 0 0.6rem; }
.prose ul, .prose ol { padding-left: 1.2rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--ice); }
.prose strong { font-weight: 650; }
.prose blockquote { margin: 1.6rem 0; padding: 0.2rem 0 0.2rem 1.2rem; border-left: 3px solid var(--steel); color: #c9d6ee; }
.prose code { font-size: 0.92em; background: var(--deep); padding: 0.1em 0.35em; border-radius: 5px; }
.prose img { border-radius: var(--radius); margin-block: 1.6rem; }
.prose__date { color: var(--mist); font-size: 0.95rem; }
.prose-page .prose { font-size: 1.05rem; }

/* Blog post */
.post { padding-block: clamp(2.5rem, 7vw, 5rem); }
.post__header { max-width: 46rem; margin-bottom: 2.5rem; }
.post__meta { color: var(--mist); font-size: 0.95rem; margin-bottom: 1.2rem; }
.post__meta a { color: var(--mist); }
.post__header h1 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 1.1rem; }
.post__lede { font-size: 1.2rem; color: #c9d6ee; margin: 0; }
.post__cta {
  max-width: 42rem; margin-top: 3.5rem; padding: clamp(1.4rem, 4vw, 2.2rem);
  border-radius: 18px; border: 1px solid rgba(111, 179, 226, 0.35);
  background: radial-gradient(120% 140% at 0% 0%, rgba(154, 209, 244, 0.14), transparent 55%), var(--deep);
}
.post__cta h2 { font-size: 1.4rem; margin-bottom: 0.6rem; }
.post__cta > p { color: #c9d6ee; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 3rem 2.5rem; font-size: 0.95rem; color: var(--mist); }
.site-footer__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; }
.site-footer__brand { display: flex; gap: 1rem; align-items: flex-start; }
.site-footer__brand img { height: 2.6rem; width: auto; flex: none; }
.site-footer__brand p { margin: 0; }
.site-footer__nav { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-end; }
.site-footer__nav a { color: var(--mist); text-decoration: none; }
.site-footer__nav a:hover { color: var(--ink); }
.site-footer__legal { grid-column: 1 / -1; margin: 0; font-size: 0.85rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.site-footer__legal a { color: var(--mist); }
@media (max-width: 40rem) {
  .site-footer__inner { grid-template-columns: 1fr; }
  .site-footer__nav { align-items: flex-start; }
}
