html {
  box-sizing: border-box;
}

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

:root {
  color-scheme: dark;
  --background: #2f4418;
  --text: #e0e0cd;
  --primary: #dddc9d;
  --accent: #ec95ac;
  --band: #233410;
  --surface: #374d20;
  --raised: #3d5424;
  --ink: #1c2a0e;
  --line: #647347;
  --muted: #d0d5bb;
  --shadow: 0 12px 30px rgba(17, 26, 8, 0.2);
  --radius: 16px;
}

html:has(dialog:modal) {
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

h1, h2, h3, p, ol, ul {
  margin: 0;
}

h1, h2, h3 {
  line-height: 1.15;
}

h1 {
  color: var(--primary);
  font-size: 32px;
  font-weight: 700;
}

h2 {
  font-size: 26px;
  font-weight: 600;
}

h3 {
  font-size: 22px;
  font-weight: 700;
}

a {
  color: var(--primary);
  text-underline-offset: 0.16em;
}

button {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

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

.north-notebook, .north-notebook-inner {
  width: calc(100% - 72px);
  max-width: 988px;
  margin-inline: auto;
  padding-inline: 0;
}

.north-notebook {
  flex: 1 0 auto;
  padding-block: 60px;
}

.notebook-head, .notebook-foot {
  background: var(--band);
}

.notebook-head {
  position: static;
  border-block-end: 1px solid var(--line);
}

.notebook-head > .north-notebook-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  min-height: 88px;
  padding-block: 10px;
}

.north-notebook-skip {
  position: absolute;
  z-index: 2;
  inset-block-start: 8px;
  inset-inline-start: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.north-notebook-skip:focus {
  width: auto;
  height: auto;
  padding: 8px 14px;
  overflow: visible;
  border-radius: 8px;
  background: var(--primary);
  color: var(--ink);
  clip-path: none;
}

.notebook-name {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 44px;
  padding-inline: 8px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--raised);
  color: var(--primary);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 1;
  text-decoration: none;
}

.notebook-name span {
  color: var(--accent);
}

.primary-nav ul, .notebook-foot ul, .landscape-notes-entry-links ul, .notebook-path ol,
.landscape-index-list, .slide-options, .landscape-list-entry-list {
  padding: 0;
  list-style: none;
}

.primary-nav ul, .notebook-foot ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.primary-nav li, .notebook-foot li {
  position: relative;
  min-width: 0;
}

.primary-nav li + li::before, .notebook-foot li + li::before {
  position: absolute;
  inset-block: 25%;
  inset-inline-start: -8px;
  width: 1px;
  background: var(--line);
  content: '';
}

.primary-nav a, .notebook-foot a, .landscape-notes-entry-links a, .north-contents-toggle,
.north-contents-close, .button-link, .landscape-deck-choice, .landscape-deck-playback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.primary-nav [aria-current='page'], .notebook-foot [aria-current='page'],
.landscape-notes-entry-links [aria-current='page'], .north-notebook-front .primary-nav .landscape-card-home-link {
  border-color: var(--primary);
}

.button-link {
  background: var(--primary);
  color: var(--ink);
}

.notebook-name, .primary-nav a, .notebook-foot a, .landscape-notes-entry-links a,
.north-contents-toggle, .north-contents-close, .button-link, .landscape-deck-choice, .landscape-deck-playback {
  transition: border-color 400ms ease;
}

@media (hover: hover) {
  .notebook-name:hover, .primary-nav a:hover, .notebook-foot a:hover,
  .landscape-notes-entry-links a:hover, .north-contents-toggle:hover, .north-contents-close:hover,
  .landscape-deck-choice:hover, .landscape-deck-playback:hover {
    border-color: var(--accent);
  }

  .button-link:hover {
    border-color: var(--ink);
  }
}

.compass-icon {
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--band);
  color: var(--primary);
}

.north-contents-toggle {
  gap: 8px;
  margin-inline-start: auto;
}

.north-menu-panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(360px, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 24px;
  overflow-y: auto;
  border: 0;
  border-radius: 16px 0 0 16px;
  background: var(--band);
  color: var(--text);
  box-shadow: var(--shadow);
}

.north-menu-panel::backdrop {
  background: rgba(16, 23, 8, 0.72);
}

.north-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 20px;
  padding-block-end: 14px;
  border-block-end: 1px solid var(--line);
}

.north-menu-panel .primary-nav ul {
  display: grid;
  gap: 8px;
}

.north-menu-panel .primary-nav li {
  padding-inline-start: 12px;
}

.north-menu-panel .primary-nav li + li::before {
  inset-inline-start: 0;
}

.north-menu-panel .primary-nav a {
  width: 100%;
  justify-content: flex-start;
}

.home-frame {
  display: grid;
  align-content: start;
  gap: 60px;
}

.north-intro {
  position: relative;
  display: grid;
  isolation: isolate;
  align-content: center;
  gap: 10px;
  min-height: 176px;
  padding: 32px;
  overflow: hidden;
  border-radius: var(--radius);
  background-color: var(--band);
  background-image: linear-gradient(90deg, var(--band) 20%, transparent 90%), linear-gradient(90deg, rgba(221, 220, 157, 0.09) 1px, transparent 1px), linear-gradient(rgba(221, 220, 157, 0.09) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
  box-shadow: var(--shadow);
}

.north-intro p, .notebook-foot p {
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.north-intro p, .north-intro h1 {
  max-width: 62%;
}

.north-intro-art {
  position: absolute;
  z-index: -1;
  inset-block: 0;
  inset-inline-end: 20px;
  width: 38%;
  height: 100%;
  color: var(--primary);
  pointer-events: none;
}

.landscape-index-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-block-end: 18px;
}

.landscape-index-header::after {
  flex: 1 0 12px;
  height: 1px;
  background: var(--line);
  content: '';
}

.landscape-index-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landscape-card-section {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--primary);
  font-weight: 500;
}

.selected-landscape {
  width: 75%;
  min-width: 0;
  margin-inline-start: auto;
}

.landscape-deck-playback {
  order: 1;
  min-width: 44px;
  padding: 6px;
  color: var(--primary);
}

.landscape-deck-playback svg {
  width: 16px;
  height: 16px;
}

.landscape-deck {
  display: grid;
  grid-template-areas: 'material choices';
  grid-template-columns: minmax(0, 1fr) minmax(140px, 27%);
  align-items: start;
  gap: 20px;
}

.slide-options {
  display: grid;
  grid-area: choices;
  gap: 8px;
}

.slide-options li, .landscape-deck-slides {
  min-width: 0;
}

.landscape-deck-choice {
  justify-content: flex-start;
  width: 100%;
  line-height: 1.25;
  text-align: start;
}

.landscape-deck-choice[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--band);
  color: var(--primary);
}

.landscape-deck-slides {
  grid-area: material;
}

.landscape-deck-item {
  display: grid;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--band);
  box-shadow: var(--shadow);
}

.landscape-deck-item img, .landscape-deck-copy {
  grid-area: 1 / 1;
  min-width: 0;
}

.landscape-deck-item img {
  align-self: start;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--raised);
  object-fit: cover;
  filter: saturate(0.65) brightness(0.75);
}

.landscape-deck-copy {
  position: relative;
  align-self: end;
  padding: 32px;
  background: linear-gradient(180deg, rgba(28, 42, 14, 0.95), var(--ink));
}

.landscape-deck-item h3 {
  margin-block-end: 16px;
  padding-inline-start: 14px;
  border-inline-start: 2px solid var(--accent);
  color: var(--primary);
  font-size: clamp(32px, 4.8vw, 54px);
  line-height: 1.02;
}

.landscape-deck-item .button-link:focus-visible {
  outline-offset: 3px;
}

.landscape-list-entry-list {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

.landscape-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: right;
}

.landscape-card:first-child {
  background: var(--raised);
}

.landscape-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: var(--band);
  object-fit: cover;
}

.landscape-card h3, .landscape-card-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.landscape-card h3 {
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  -webkit-line-clamp: 1;
}

.landscape-card-summary {
  -webkit-line-clamp: 2;
}

.landscape-card-details {
  display: flex;
  justify-content: flex-end;
}

.north-notebook-read-length {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.25;
}

.landscape-card .button-link {
  align-self: center;
}

.north-essay-layout {
  display: grid;
  grid-template-columns: minmax(0, 600px) 234px;
  align-content: start;
  align-items: start;
  justify-content: center;
  column-gap: 34px;
}

.north-essay {
  width: 100%;
  min-width: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.notebook-path {
  margin-block-end: 16px;
  font-size: 16px;
}

.notebook-path ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.notebook-path li {
  min-width: 0;
}

.notebook-path [aria-hidden='true'] {
  margin-inline-end: 10px;
  color: var(--accent);
}

.north-essay .landscape-card-story-meta {
  margin-block: 12px 24px;
  padding-block-end: 16px;
  border-block-end: 1px solid var(--line);
}

.north-essay p, .north-essay blockquote, .north-essay ul, .north-essay ol {
  margin-block: 16px;
}

.north-essay .notebook-path ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.north-essay h2, .north-essay h3 {
  margin-block: 1.2em 0.5em;
  color: var(--primary);
}

.north-essay ul, .north-essay ol {
  padding-inline-start: 1.5em;
}

.north-essay ul {
  list-style: disc;
}

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

.north-essay blockquote {
  padding: 16px 20px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--surface);
}

.north-essay blockquote p:first-child {
  margin-block-start: 0;
}

.north-essay blockquote p:last-child {
  margin-block-end: 0;
}

.north-essay cite {
  color: var(--primary);
  font-style: italic;
}

.north-essay table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.north-essay th, .north-essay td {
  padding: 8px 12px;
  border: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

.north-essay th {
  background: var(--band);
  color: var(--primary);
  font-weight: 700;
}

.north-essay caption {
  padding-block-end: 8px;
  color: var(--primary);
  font-weight: 600;
  text-align: start;
}

.landscape-notes-related {
  width: 100%;
  min-width: 0;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.landscape-notes-related .landscape-index-header {
  margin-block-end: 12px;
}

.landscape-notes-related h2 {
  font-size: 22px;
}

.landscape-notes-entry-links ul {
  display: grid;
  gap: 8px;
}

.landscape-notes-entry-links a {
  justify-content: flex-start;
  width: 100%;
  background: var(--band);
}

.notebook-foot {
  border-block-start: 1px solid var(--line);
}

.notebook-foot .north-notebook-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 24px;
}

.north-notebook-enter.north-notebook-in-view:not(:focus-within) {
  animation: enter-items 400ms ease-out 150ms backwards;
}

@keyframes enter-items {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 854px) {
  body {
    font-size: 18px;
  }

  .notebook-head > .north-notebook-inner {
    min-height: 64px;
  }

  .notebook-head > .north-notebook-inner > .primary-nav {
    flex-basis: 100%;
  }

  .north-notebook {
    padding-block: 40px;
  }

  .home-frame, .north-essay-layout {
    gap: 40px;
  }

  .north-intro {
    min-height: 148px;
    padding: 24px;
  }

  .north-intro p, .north-intro h1 {
    max-width: 100%;
  }

  .north-intro-art {
    inset-inline-end: 8px;
    width: 50%;
    opacity: 0.3;
  }

  .selected-landscape {
    width: 100%;
  }

  .landscape-deck {
    grid-template-areas: 'choices' 'material';
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .slide-options {
    display: flex;
    flex-wrap: wrap;
  }

  .slide-options li {
    flex: 1 1 128px;
  }

  .landscape-deck-slides {
    width: 100%;
    max-width: 600px;
    margin-inline: auto;
  }

  .landscape-deck-copy {
    padding: 20px;
  }

  .landscape-deck-item h3 {
    font-size: clamp(28px, 6.5vw, 44px);
  }

  .landscape-list-entry-list, .north-essay-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .landscape-card {
    width: 100%;
    max-width: 600px;
    margin-inline: auto;
    padding: 20px;
  }

  .landscape-notes-related {
    max-width: 600px;
    margin-inline: auto;
  }
}

@media (max-width: 480px) {
  .north-notebook, .north-notebook-inner {
    width: calc(100% - 44px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .north-notebook-enter.north-notebook-in-view:not(:focus-within) {
    animation: none;
  }

  .notebook-name, .primary-nav a, .notebook-foot a, .landscape-notes-entry-links a,
  .north-contents-toggle, .north-contents-close, .button-link, .landscape-deck-choice, .landscape-deck-playback {
    transition: none;
  }
}

.north-essay .north-essay-cover { display:block; width:100%; height:auto; aspect-ratio:3/2; object-fit:cover; margin:1.25rem 0 1.5rem; }
.landscape-index-list a.landscape-card-section { text-decoration:none; }
.landscape-card-details time,.landscape-card-story-meta time { white-space:nowrap; }
@media(max-width:640px){.north-essay .north-essay-cover{margin:1rem 0;}}

.north-notebook-front .landscape-card img {
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:3 / 2;
  object-fit:cover;
  flex:none;
}
.north-notebook-front .landscape-deck-item img {
  width:100%;
  height:auto;
  aspect-ratio:16 / 9;
  object-fit:cover;
}
@media(max-width:640px) {
  .north-notebook-front .landscape-deck-item img,
  .north-notebook-front .landscape-deck-copy {grid-area:auto;}
}
