/* ==========================================================================
   Indra Birdsill-Mrla
   ========================================================================== */

/* Fonts: self-hosted under the SIL Open Font License (see /fonts) */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/newsreader-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/newsreader-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
}

/* --------------------------------------------------------------------------
   Design tokens (dark theme is the default)
   -------------------------------------------------------------------------- */
:root {
  --ocean: #0b1820;
  --ocean-2: #10222c;
  --forest: #0d1d19;
  --soil: #1b1712;
  --surface: #13242d;
  --tile: rgba(11, 24, 32, 0.55);
  --text: #edf0ec;
  --muted: #a9b5b8;
  --line: rgba(237, 240, 236, 0.14);
  --accent: #c9a77c;
  --accent-soft: rgba(201, 167, 124, 0.7);
  --btn-bg: #edf0ec;
  --btn-text: #0b1820;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;

  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: clamp(36px, 4.5vw, 48px);
  --s-6: clamp(48px, 6vw, 72px);
  --s-sec: clamp(72px, 9vw, 120px);
  --header-h: 76px;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --ocean: #f2f4f3;
  --ocean-2: #e8edec;
  --forest: #e4ebe5;
  --soil: #ede7df;
  --surface: #ffffff;
  --tile: rgba(255, 255, 255, 0.6);
  --text: #13232c;
  --muted: #4a5a60;
  --line: rgba(19, 35, 44, 0.16);
  --accent: #7a5530;
  --accent-soft: rgba(122, 85, 48, 0.7);
  --btn-bg: #13232c;
  --btn-text: #f2f4f3;

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--ocean);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1.1em;
  max-width: 64ch;
}

figure {
  margin: 0;
}

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

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: absolute;
  top: 10px;
  left: -999px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 700;
}

.skip:focus {
  left: 12px;
}

.lead {
  margin-bottom: 1.1em;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.45;
}

.flush {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Header and navigation
   -------------------------------------------------------------------------- */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--ocean);
  border-bottom: 1px solid var(--line);
}

.top .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tabs {
  display: flex;
  gap: 2px;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 1.02rem;
  text-decoration: none;
}

.tabs a:hover,
.tabs a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.35em;
}

.tabs a[aria-current="page"] {
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
}

.theme {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.theme svg {
  width: 20px;
  height: 20px;
}

/* --------------------------------------------------------------------------
   Buttons and links
   -------------------------------------------------------------------------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 52px;
  padding: 0 1.5em;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 1.02rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-solid {
  background: var(--btn-bg);
  color: var(--btn-text);
}

.textlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--accent);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-4);
}

.iconlink {
  gap: 10px;
  text-decoration: none;
}

.iconlink:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--accent);
}

.iconlink img {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

/* --------------------------------------------------------------------------
   Media
   -------------------------------------------------------------------------- */
.media {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.sec {
  padding: var(--s-sec) 0;
}

.sec.forest { background: var(--forest); }
.sec.soil { background: var(--soil); }
.sec.tint { background: var(--ocean-2); }

.h2 {
  font-size: clamp(2rem, 3.6vw, 2.9rem);
}

.sec-head {
  margin-bottom: var(--s-5);
}

.split {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: var(--s-5) clamp(24px, 5vw, 72px);
  align-items: start;
}

.page-head h1 {
  margin-bottom: var(--s-3);
  font-size: clamp(3.2rem, 8vw, 6.5rem);
  letter-spacing: -0.03em;
}

.page-head .lead {
  max-width: 40ch;
  margin-bottom: 0;
}

.page-head .actions {
  margin-top: var(--s-4);
}

.after-head {
  margin-top: var(--s-6);
}

.cta {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: var(--s-4) clamp(24px, 5vw, 72px);
  align-items: end;
}

.cta h2 {
  margin-bottom: var(--s-3);
  font-size: clamp(2.4rem, 5vw, 4rem);
}

.cta .lead {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  aspect-ratio: 3 / 1;
  min-height: 200px;
  max-height: max(260px, calc(100vh - 400px));
  max-height: max(260px, calc(100svh - 400px));
  background: #2c4a66;
  color: #fff;
}

.hero .media {
  position: absolute;
  inset: 0;
  border-radius: 0;
}

.hero picture {
  display: block;
  height: 100%;
}

/* Keep the peaks in frame: any cropping is taken mostly from the bottom. */
.hero .media img {
  object-position: center 25%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(6, 14, 19, 0.82) 0%, rgba(6, 14, 19, 0.42) 32%, rgba(6, 14, 19, 0) 60%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-bottom: clamp(20px, 3.5vw, 44px);
}

.hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.35);
}

.sec.bio {
  padding-top: clamp(40px, 5vw, 64px);
}

.bio-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-4) clamp(32px, 6vw, 80px);
  align-items: start;
}

.headshot {
  width: clamp(180px, 19vw, 240px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.bio p {
  max-width: 44ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  line-height: 1.5;
}

.bio .textlink {
  margin-top: var(--s-3);
}

.connect {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-2);
}

.tile {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-4) 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--tile);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.tile:hover {
  border-color: var(--accent-soft);
  background: var(--ocean);
}

.tile .logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 16px;
}

.tile .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tile .logo.ig {
  padding: 4px;
}

.tile .mail {
  background: var(--btn-bg);
  color: var(--btn-text);
}

.tile .mail svg {
  width: 34px;
  height: 34px;
}

.tile .pname {
  display: block;
  margin-bottom: var(--s-1);
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1.1;
}

.tile .handle {
  display: block;
  color: var(--muted);
  word-break: break-word;
}

.tile .go {
  margin-top: auto;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Collaborate
   -------------------------------------------------------------------------- */
.wide .media {
  aspect-ratio: 21 / 9;
}

.wide picture {
  display: block;
  height: 100%;
}

.wide .media img {
  object-position: center 30%;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats div {
  display: flex;
  flex-direction: column;
  padding: var(--s-4) var(--s-3) var(--s-4) 0;
}

.stats div + div {
  padding-left: var(--s-3);
  border-left: 1px solid var(--line);
}

.stats dt {
  order: 2;
  color: var(--muted);
  font-size: 1rem;
}

.stats dd {
  order: 1;
  margin: 0 0 var(--s-1);
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  line-height: 1;
}

.note {
  margin: var(--s-2) 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.list li {
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
}

.list h3 {
  margin-bottom: var(--s-1);
  font-size: 1.6rem;
}

.list p {
  margin: 0;
  color: var(--muted);
}

.list .tagline {
  margin: 0 0 var(--s-1);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.2rem;
}

/* --------------------------------------------------------------------------
   Projects
   -------------------------------------------------------------------------- */
.projects {
  display: flex;
  flex-direction: column;
  gap: var(--s-sec);
}

.project {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--s-4) clamp(32px, 6vw, 88px);
  align-items: center;
}

.project:nth-child(even) {
  grid-template-columns: 7fr 5fr;
}

.project:nth-child(even) .media {
  order: 2;
}

.project .media {
  aspect-ratio: 1 / 1;
}

.project .media.contain {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
}

.project .media.contain img {
  width: 72%;
  height: auto;
  object-fit: contain;
}

.project .kind {
  display: block;
  margin-bottom: var(--s-1);
  color: var(--muted);
  font-size: 1rem;
}

.project h2 {
  margin-bottom: var(--s-2);
  font-size: clamp(2rem, 3.6vw, 2.9rem);
}

.project p {
  color: var(--muted);
}

.project.text-only {
  grid-template-columns: 1fr;
  max-width: 860px;
  padding-top: var(--s-sec);
  border-top: 1px solid var(--line);
}

.bullets {
  margin: 0 0 1.1em;
  padding-left: 1.2em;
  color: var(--muted);
}

.bullets li {
  margin-bottom: var(--s-1);
}

.bullets li::marker {
  color: var(--accent);
}

.yt-light {
  display: none;
}

:root[data-theme="light"] .yt-dark {
  display: none;
}

:root[data-theme="light"] .yt-light {
  display: block;
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.story {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--s-5) clamp(32px, 6vw, 88px);
  align-items: stretch;
}

/* The photo grid takes its height from the story beside it. */
.photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--s-2);
  min-height: 440px;
  contain: size;
}

.photos .media {
  height: 100%;
  min-height: 0;
}

.ph-lake img { object-position: 58% center; }
.ph-hike img { object-position: center 30%; }
.ph-studio img { object-position: 53% center; }
.ph-dog img { object-position: center 30%; }

.story .body p {
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.75;
}

.story .body p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.foot {
  padding: var(--s-4) 0;
  border-top: 1px solid var(--line);
  font-size: 0.98rem;
}

.foot .bar {
  display: flex;
  justify-content: center;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .top .bar {
    flex-wrap: wrap;
    gap: 0;
    padding-top: 6px;
  }

  .brand {
    order: 1;
    flex: 1;
  }

  .top-right {
    display: contents;
  }

  .theme {
    order: 2;
  }

  .tabs {
    order: 3;
    justify-content: space-between;
    width: 100%;
    margin: 6px calc(var(--gutter) * -1) 0;
    padding: 2px calc(var(--gutter) - 8px);
    border-top: 1px solid var(--line);
  }

  .tabs a {
    padding: 10px 8px;
  }

  .split,
  .cta,
  .story,
  .project,
  .project:nth-child(even),
  .bio-grid {
    grid-template-columns: 1fr;
  }

  .project:nth-child(even) .media {
    order: 0;
  }

  .project .media {
    max-width: 480px;
  }

  .headshot {
    width: 140px;
  }

  .connect {
    grid-template-columns: 1fr;
  }

  .tile {
    flex-direction: row;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3);
  }

  .tile .meta {
    flex: 1;
    min-width: 0;
  }

  .tile .go {
    margin-top: 0;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .stats div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .wide .media {
    aspect-ratio: 3 / 2;
  }

  .story .body {
    order: -1;
  }

  .photos {
    grid-template-rows: auto auto;
    min-height: 0;
    contain: none;
  }

  .photos .media {
    aspect-ratio: 1 / 1;
    height: auto;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 1.0625rem;
  }

  .brand {
    font-size: 1.3rem;
  }

  .tabs a {
    padding: 10px 6px;
    font-size: 0.98rem;
  }

  .actions .btn {
    flex: 1 1 100%;
  }

  .tile .go {
    display: none;
  }

  .tile .pname {
    font-size: 1.6rem;
  }

  .tile .logo {
    width: 60px;
    height: 60px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
