:root {
  color-scheme: light;
  --ink: #0d2b2a;
  --secondary: #0e2c2b;
  --line: rgba(13, 43, 42, 0.22);
  --sidebar: rgba(225, 252, 244, 0.78);
  --focus: #0d2b2a;
  --cyan: #70e6f0;
  --sea-green: #4fc49a;
  --font-display: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --font-body: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: Menlo, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: linear-gradient(118deg, var(--cyan), var(--sea-green));
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  cursor: pointer;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  touch-action: manipulation;
}

a:active {
  text-decoration-thickness: 2px;
}

::selection {
  background: var(--ink);
  color: white;
}

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

.hex-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.skip-link {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  transform: translateY(-180%);
  background: var(--ink);
  color: white;
  font-weight: 600;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  width: 188px;
  padding: 36px 24px 28px;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.brand {
  display: flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 500;
  text-decoration: none;
}

.menu {
  display: grid;
  margin-top: 54px;
  gap: 4px;
}

.menu a {
  display: flex;
  min-height: 44px;
  align-items: center;
  color: var(--secondary);
  font-size: 0.9rem;
  font-weight: 400;
  text-decoration-color: transparent;
  transition:
    color 180ms ease,
    text-decoration-color 180ms ease;
}

.menu a:hover,
.menu a[aria-current] {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.menu a[aria-current] {
  font-weight: 500;
}

.sidebar-note {
  margin: auto 0 0;
  color: var(--secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
}

.sidebar-note span,
.sidebar-note time {
  display: block;
}

main {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 188px), 860px);
  margin-left: 188px;
  padding: 104px clamp(40px, 7vw, 88px) 52px;
  font-size: 17px;
  text-shadow:
    0 1px 0 rgba(216, 251, 244, 0.92),
    0 0 2px rgba(216, 251, 244, 0.68);
}

article,
.page-footer {
  max-width: 610px;
}

.page-hero {
  padding: 24px 0 76px;
}

.eyebrow,
.status-line,
.section-label {
  margin: 0 0 10px;
  color: var(--secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
}

h1 {
  max-width: 590px;
  margin-bottom: 24px;
  font-size: clamp(3rem, 6vw, 4.7rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.lede {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--secondary);
  font-size: clamp(1.08rem, 2vw, 1.22rem);
}

.content-section {
  padding: 54px 0;
  border-top: 1px solid var(--line);
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(1.75rem, 4vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.2rem;
  font-weight: 500;
}

.content-section > p,
.content-section li p {
  max-width: 560px;
  color: var(--secondary);
}

.plain-list,
.project-index,
.evidence-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.plain-list li,
.project-index li,
.evidence-list li {
  padding: 20px 0 22px;
  border-top: 1px solid var(--line);
}

.project-index h2,
.project-index h3 {
  margin: 0 0 7px;
  font-size: 1.25rem;
}

.project-index p,
.evidence-list p {
  margin-bottom: 0;
}

.status-line {
  display: block;
  margin-bottom: 7px;
}

.scope-note,
.honesty-note {
  max-width: 560px;
  margin: 24px 0 0;
  padding-left: 18px;
  border-left: 2px solid var(--ink);
  color: var(--secondary);
}

.scope-note strong,
.honesty-note strong {
  color: var(--ink);
}

.page-links {
  display: flex;
  margin: 28px 0 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
}

.page-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.next-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 8px;
}

.page-footer {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  color: var(--secondary);
  font-size: 0.82rem;
}

.page-footer a {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
}

@media (max-width: 760px), (max-height: 520px) {
  html {
    scroll-padding-top: calc(80px + env(safe-area-inset-top));
  }

  .sidebar {
    right: 0;
    bottom: auto;
    width: auto;
    padding: calc(12px + env(safe-area-inset-top)) 18px 10px;
    align-items: center;
    flex-direction: row;
    gap: 16px;
    overflow-y: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .menu {
    display: flex;
    min-width: 0;
    margin: 0 0 0 auto;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: none;
  }

  .menu::-webkit-scrollbar {
    display: none;
  }

  .menu a {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    font-size: 0.85rem;
  }

  .sidebar-note {
    display: none;
  }

  main {
    width: min(calc(100% - 36px), 610px);
    margin: 0 auto;
    padding: calc(92px + env(safe-area-inset-top)) 0 40px;
  }

  .page-hero {
    padding: 48px 0 68px;
  }

  h1 {
    font-size: clamp(2.8rem, 14vw, 4.25rem);
  }

  .content-section {
    padding: 48px 0;
  }
}

@media (max-width: 430px) {
  .brand {
    font-size: 0.96rem;
  }

  .menu a {
    font-size: 0.85rem;
  }

  .menu a[href="portfolio.html"] {
    display: none;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
