/* ==========================================================================
   JR Tibbetts — site styles
   Palette is keyed to stage filters: warm (R02 bastard amber) for design,
   cool (L201 full CTB) for academics. Everything else stays quiet.
   ========================================================================== */

:root {
  /* Color */
  --ink:        #12131a;   /* house at preset — blue-black, never pure black */
  --ink-soft:   #1c1e28;
  --paper:      #edeef0;   /* cool paper, not cream */
  --paper-warm: #f6f5f3;
  --amber:      #e8a65c;   /* R02 */
  --ctb:        #6e9bd4;   /* L201 */
  --gray:       #6b7078;
  --gray-light: #a4abb4;

  --line-dark:  rgba(255, 255, 255, 0.14);
  --line-light: rgba(18, 19, 26, 0.14);

  /* Set per page by .theme-warm / .theme-cool */
  --accent: var(--amber);

  /* Type */
  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body:    'Source Serif 4', Georgia, 'Times New Roman', serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --step--1: clamp(0.78rem, 0.75rem + 0.15vw, 0.86rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2:  clamp(1.6rem, 1.35rem + 1.2vw, 2.3rem);
  --step-3:  clamp(2.2rem, 1.6rem + 3vw, 4rem);
  --step-4:  clamp(3rem, 1.8rem + 6vw, 7rem);

  /* Layout */
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --wide: 1240px;
  --measure: 64ch;
}

.theme-warm { --accent: var(--amber); }
.theme-cool { --accent: var(--ctb); }

/* --------------------------------------------------------- reset + base */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-stretch: 112%;
  text-wrap: balance;
}

p { text-wrap: pretty; }

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

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--step--1);
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus { top: 0.5rem; }

/* Small caps-y utility label used for eyebrows, captions, terms. */
.label {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
}

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

/* ------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-dark);
  color: var(--paper);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 0.9rem;
}

.wordmark {
  font-family: var(--display);
  font-size: var(--step-0);
  font-weight: 700;
  font-stretch: 125%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* Two channels, warm and cool — the site's whole idea in 14 pixels. */
.wordmark::before {
  content: "";
  inline-size: 0.85rem;
  block-size: 0.85rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0.45rem 0 0 var(--ctb);
  margin-inline-end: 0.45rem;
  flex: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
}

.site-nav a {
  text-decoration: none;
  color: var(--gray-light);
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover { color: #fff; }

.site-nav a[aria-current="page"] {
  color: var(--paper);
  border-bottom-color: var(--accent);
}

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

.hero {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(3rem, 8vw, 7rem);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 900px) {
  .hero__inner { grid-template-columns: 1.15fr 0.85fr; }
}

.hero__eyebrow {
  color: var(--gray-light);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: var(--step-4);
  font-weight: 700;
  font-stretch: 118%;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.hero__role {
  font-family: var(--mono);
  font-size: var(--step-0);
  color: var(--amber);
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
}

.hero__lead {
  font-size: var(--step-1);
  line-height: 1.5;
  max-width: 34ch;
  color: #dcdee3;
}

/* Signature: the portrait lit from both sides — warm from house left for
   the design work, cool from house right for the research. */
.portrait {
  position: relative;
  isolation: isolate;
  margin: 0;
}

.portrait__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-dark);
}

.portrait__frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: grayscale(0.4) contrast(1.06) brightness(0.92);
}

.portrait__wash {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: blur(30px);
}

.portrait__wash--warm {
  background: radial-gradient(58% 68% at 8% 26%, rgba(232, 166, 92, 0.62), transparent 72%);
}

.portrait__wash--cool {
  background: radial-gradient(58% 68% at 94% 74%, rgba(110, 155, 212, 0.55), transparent 72%);
}

.portrait figcaption {
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--gray);
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: no-preference) {
  .portrait__wash { animation: breathe 14s ease-in-out infinite; }
  .portrait__wash--cool { animation-delay: -7s; }

  .hero__eyebrow,
  .hero h1,
  .hero__role,
  .hero__lead,
  .portrait { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) backwards; }

  .hero h1      { animation-delay: 0.06s; }
  .hero__role   { animation-delay: 0.12s; }
  .hero__lead   { animation-delay: 0.18s; }
  .portrait     { animation-delay: 0.24s; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.78; }
  50%      { opacity: 1; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------- channels */

.channels {
  padding-block: clamp(3rem, 8vw, 6rem);
}

.channels__grid {
  display: grid;
  gap: 1px;
  background: var(--line-light);
  border: 1px solid var(--line-light);
}

@media (min-width: 760px) {
  .channels__grid { grid-template-columns: 1fr 1fr; }
}

.channel {
  --channel: var(--ctb);
  background: var(--paper-warm);
  padding: clamp(1.75rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  transition: background 0.3s ease;
}

.channel--design { --channel: var(--amber); }

.channel::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 0;
  block-size: 3px;
  background: var(--channel);
}

.channel:hover { background: #fff; }

.channel h2 {
  font-size: var(--step-2);
  margin-block: 0.25rem 0;
}

.channel p {
  color: #3a3d45;
  max-width: 44ch;
  flex: 1;
}

.channel__link {
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  align-self: start;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid var(--channel);
  transition: gap 0.2s ease;
}

.channel__link::after {
  content: " \2192";
  display: inline-block;
  transition: transform 0.2s ease;
}

.channel:hover .channel__link::after { transform: translateX(4px); }

/* Whole card is clickable, but the real link still owns the focus ring. */
.channel__link::before {
  content: "";
  position: absolute;
  inset: 0;
}

/* ----------------------------------------------------------- offstage */

.offstage {
  background: var(--ink);
  color: #dcdee3;
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.offstage__grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
}

@media (min-width: 760px) {
  .offstage__grid { grid-template-columns: 18ch 1fr; }
}

.offstage h2 {
  font-size: var(--step-1);
  color: var(--paper);
}

.offstage p + p { margin-top: 1rem; }

.offstage .stat {
  font-family: var(--mono);
  color: var(--amber);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  display: block;
  margin-top: 1.5rem;
}

/* ------------------------------------------------------- inner pages */

.page-head {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem);
}

.page-head h1 {
  font-size: var(--step-3);
  margin-top: 0.75rem;
}

.page-head p {
  margin-top: 1rem;
  max-width: var(--measure);
  color: var(--gray);
  font-size: var(--step-1);
}

.section {
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line-light);
}

.section h2 {
  font-size: var(--step-2);
  margin-bottom: 1.25rem;
}

.prose {
  max-width: var(--measure);
}

.prose p + p { margin-top: 1rem; }

.prose a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose a:hover { color: color-mix(in srgb, var(--accent) 70%, var(--ink)); }

/* Course list: the term is data, so it gets the mono treatment. */
.course-list {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line-light);
  max-width: 46rem;
}

.course-list li {
  display: grid;
  gap: 0.15rem 1.5rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--line-light);
}

@media (min-width: 620px) {
  .course-list li {
    grid-template-columns: 12ch 1fr;
    align-items: baseline;
  }
}

.course-list .term {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--gray);
  letter-spacing: 0.04em;
}

.course-list .note {
  display: block;
  font-size: var(--step--1);
  color: var(--gray);
}

.pub-blurb {
  margin: 0.5rem 0 0;
  color: var(--ink);
  max-width: 42rem;
}

/* --------------------------------------------------- design page / dark */

.page-dark {
  background: var(--ink);
  color: #dcdee3;
}

.page-dark .page-head h1,
.page-dark .section h2,
.page-dark h3 { color: var(--paper); }

.page-dark .page-head p,
.page-dark .section p { color: var(--gray-light); }

.page-dark .section { border-top-color: var(--line-dark); }

.project + .project { margin-top: clamp(3rem, 7vw, 5rem); }

.project__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-bottom: 1rem;
}

.project h3 {
  font-size: var(--step-2);
  font-weight: 600;
}

.project__meta { color: var(--gray); }

.project__note {
  max-width: var(--measure);
  margin-bottom: 1.75rem;
}

/* ------------------------------------------------------ Glide (v3.7.1)
   Core styles inlined so the carousel has no CDN dependency. */

.glide { position: relative; width: 100%; box-sizing: border-box; }
.glide * { box-sizing: inherit; }
.glide__track { overflow: hidden; }
.glide__slides {
  position: relative;
  width: 100%;
  list-style: none;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  touch-action: pan-Y;
  overflow: hidden;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  display: flex;
  flex-wrap: nowrap;
  will-change: transform;
}
.glide__slides--dragging { user-select: none; }
.glide__slide {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  white-space: normal;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.glide__arrows, .glide__bullets { -webkit-touch-callout: none; user-select: none; }
.glide--rtl { direction: rtl; }

/* Carousel skin */

.glide__slide img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: var(--ink-soft);
  border: 1px solid var(--line-dark);
}

.glide__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  background: rgba(18, 19, 26, 0.72);
  backdrop-filter: blur(6px);
  color: var(--paper);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.glide__arrow:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}

.glide__arrow--left  { left: clamp(0.5rem, 2vw, 1.25rem); }
.glide__arrow--right { right: clamp(0.5rem, 2vw, 1.25rem); }

.carousel-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.9rem;
}

.carousel-count {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--gray);
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.carousel-progress {
  flex: 1;
  block-size: 2px;
  background: var(--line-dark);
  position: relative;
}

.carousel-progress span {
  position: absolute;
  inset-block: 0;
  left: 0;
  background: var(--amber);
  transition: width 0.35s ease;
}

/* ------------------------------------------------------------- footer */

.site-footer {
  background: var(--ink);
  color: var(--gray-light);
  border-top: 1px solid var(--line-dark);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}

.site-footer h2 {
  font-size: var(--step--1);
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 0.6rem;
}

.site-footer a {
  color: var(--paper);
  text-decoration-color: var(--line-dark);
  text-underline-offset: 3px;
}

.site-footer a:hover { text-decoration-color: var(--accent); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
}

.colophon {
  margin-top: 2.5rem;
  font-family: var(--mono);
  font-size: var(--step--1);
}

/* Small type on ink needs the lighter gray to clear contrast minimums. */
.hero .label,
.offstage .label,
.page-dark .label,
.portrait figcaption,
.carousel-count,
.site-footer h2,
.colophon { color: var(--gray-light); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
