/* Andrew Wiggin — an independent field journal.
   Local assets, system fonts, native disclosures; no remote dependencies. */

:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --paper-deep: #eeebe2;
  --ink: #282c29;
  --muted: #60665f;
  --accent: #385947;
  --accent-dark: #234132;
  --rule: #d8d8ce;
  --white: #fffdf7;
  --font-display: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --content-width: 1320px;
  --gutter: clamp(22px, 4.2vw, 64px);
  --section-space: clamp(64px, 7vw, 108px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

main {
  display: block;
  min-width: 0;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

button,
summary,
input[type="submit"] {
  cursor: pointer;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

a:hover {
  color: var(--accent);
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3,
h4,
p,
blockquote,
figure {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.16;
  text-wrap: balance;
}

h1 {
  font-size: clamp(44px, 5.5vw, 78px);
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(32px, 3.3vw, 46px);
  letter-spacing: -0.035em;
}

h3 {
  font-size: clamp(25px, 2.2vw, 31px);
  letter-spacing: -0.025em;
}

::selection {
  background: #d7e1d0;
  color: #17251c;
}

[hidden],
.hidden {
  display: none !important;
}

.skip-link {
  position: absolute;
  z-index: 20;
  top: 12px;
  left: var(--gutter);
  padding: 12px 20px;
  transform: translateY(-180%);
  background: var(--ink);
  color: var(--white);
}

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

.preview-bar {
  padding: 7px var(--gutter);
  background: var(--paper-deep);
  color: #51574f;
  border-bottom: 1px solid var(--rule);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.055em;
  text-align: center;
}

.site-header,
.section-heading,
.post-grid,
.about-strip,
.quote-strip,
.page-intro,
.article-header,
.article-cover,
.article-layout,
.article-end,
.about-layout,
.contact-panel,
.filter-bar,
.filter-status,
.empty-state,
.site-footer {
  width: min(var(--content-width), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 130px;
  padding-block: 26px;
}

.brand {
  display: inline-block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(27px, 2.5vw, 34px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand:hover {
  color: var(--accent);
}

.brand-sub {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.075em;
}

.menu {
  flex-shrink: 0;
}

.menu-label {
  display: none;
}

.menu nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 31px;
}

.menu nav a {
  display: inline-block;
  padding-block: 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.025em;
  text-decoration: none;
  text-underline-offset: 7px;
}

.menu nav a:hover,
.menu nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 600px;
  width: min(var(--content-width), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  padding: clamp(32px, 5vw, 76px);
  background-color: #172623;
  background-image: linear-gradient(90deg, rgb(10 20 19 / 76%) 0%, rgb(10 20 19 / 39%) 63%, rgb(10 20 19 / 18%) 100%), linear-gradient(0deg, rgb(10 20 19 / 34%), transparent 80%), var(--hero-image);
  background-position: center;
  background-size: cover;
  color: var(--white);
}

.hero-content {
  max-width: 750px;
  padding-block: 12px;
}

.eyebrow {
  display: block;
  margin-bottom: 17px;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #e4e9dc;
}

.hero h1 {
  max-width: 10.5ch;
  font-size: clamp(52px, 6.2vw, 88px);
  line-height: 1.04;
  text-shadow: 0 2px 18px rgb(0 0 0 / 18%);
}

.hero-description {
  max-width: 47ch;
  margin-top: 25px;
  color: #f1f1e9;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.75;
}

.button,
.filter-bar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 25px;
  border: 1px solid var(--accent-dark);
  border-radius: 0;
  background: var(--accent-dark);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.055em;
  text-align: center;
  text-decoration: none;
}

.button:hover,
.filter-bar button:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
}

.hero .button {
  margin-top: 31px;
  border-color: var(--white);
  background: var(--white);
  color: var(--ink);
}

.hero .button:hover {
  border-color: #dbe3d2;
  background: #dbe3d2;
  color: var(--accent-dark);
}

.hero :focus-visible {
  outline-color: #fffdf7;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-top: var(--section-space);
  margin-bottom: 32px;
}

.section-heading .eyebrow {
  margin-bottom: 11px;
}

.text-link,
.section-heading > a {
  display: inline-block;
  padding-block: 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.035em;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.section-heading > a {
  flex-shrink: 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 33px;
}

.post-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.image-link {
  display: block;
  width: 100%;
  margin-bottom: 22px;
  overflow: hidden;
  background: var(--paper-deep);
}

.image-link img {
  width: 100%;
  aspect-ratio: 1.48;
  object-fit: cover;
  transition: transform 300ms ease;
}

@media (hover: hover) {
  .image-link:hover img {
    transform: scale(1.035);
  }
}

.post-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.045em;
}

.post-meta a {
  color: var(--accent-dark);
}

.post-card h3 {
  margin-top: 12px;
  margin-bottom: 14px;
}

.post-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.post-card > p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.post-card > .text-link {
  margin-top: auto;
}

.about-strip {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: clamp(32px, 5.5vw, 84px);
  margin-top: var(--section-space);
  padding: clamp(28px, 4.5vw, 64px);
  background: var(--paper-deep);
}

.about-strip > img,
.about-strip > picture img {
  width: 100%;
  max-height: 450px;
  aspect-ratio: 1;
  object-fit: cover;
}

.about-strip h2 {
  max-width: 19ch;
  margin-bottom: 22px;
}

.about-strip p:not(.eyebrow) {
  max-width: 54ch;
  margin-bottom: 18px;
  color: #50574e;
  font-size: 15px;
}

.quote-strip {
  padding: clamp(64px, 7.5vw, 112px) clamp(12px, 9vw, 130px);
  text-align: center;
}

.quote-strip blockquote {
  max-width: 30ch;
  margin-inline: auto;
  font-family: var(--font-display);
  font-size: clamp(27px, 3vw, 41px);
  font-style: italic;
  line-height: 1.45;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.quote-strip cite {
  display: block;
  margin-top: 23px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-intro,
.article-header {
  padding-top: clamp(34px, 5vw, 72px);
  padding-bottom: clamp(38px, 4.5vw, 65px);
}

.page-intro h1 {
  max-width: 20ch;
}

.page-intro > p:not(.eyebrow),
.article-deck {
  max-width: 62ch;
  margin-top: 23px;
  color: var(--muted);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.75;
}

.article-header h1 {
  max-width: 22ch;
  font-size: clamp(39px, 4.8vw, 68px);
}

.article-header .post-meta {
  margin-top: 27px;
  font-size: 12px;
}

.article-cover {
  margin-bottom: clamp(42px, 5vw, 72px);
}

.article-cover img,
img.article-cover {
  width: 100%;
  max-height: 670px;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

img.article-cover {
  width: min(var(--content-width), calc(100% - var(--gutter) * 2));
}

.article-cover figcaption,
.article-body figcaption,
.prose figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 76ch) minmax(180px, 1fr);
  align-items: start;
  gap: clamp(40px, 7vw, 100px);
}

.article-body,
.prose {
  min-width: 0;
  max-width: 70ch;
  font-size: 17px;
  line-height: 1.9;
}

.article-body > * + *,
.prose > * + * {
  margin-top: 1.4em;
}

.article-body h2,
.prose h2 {
  margin-top: 1.9em;
  font-size: clamp(29px, 3vw, 39px);
}

.article-body h3,
.prose h3 {
  margin-top: 1.7em;
  font-size: 27px;
}

.article-body :is(h2, h3, h4) + *,
.prose :is(h2, h3, h4) + * {
  margin-top: 0.8em;
}

.article-body > :first-child,
.prose > :first-child {
  margin-top: 0;
}

.article-body :is(ul, ol),
.prose :is(ul, ol) {
  padding-left: 1.4em;
}

.article-body li + li,
.prose li + li {
  margin-top: 0.55em;
}

.article-body blockquote,
.prose blockquote {
  padding: 8px 0 8px 25px;
  border-left: 2px solid var(--accent);
  color: #455348;
  font-family: var(--font-display);
  font-size: 1.35em;
  font-style: italic;
  line-height: 1.6;
}

.article-body blockquote > * + *,
.prose blockquote > * + * {
  margin-top: 1em;
}

.article-body img,
.prose img {
  max-width: 100%;
  height: auto;
}

.article-body code,
.prose code {
  padding: 0.15em 0.3em;
  background: var(--paper-deep);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

.article-body pre,
.prose pre {
  max-width: 100%;
  padding: 20px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
  line-height: 1.6;
  tab-size: 2;
}

.article-body pre code,
.prose pre code {
  padding: 0;
  background: transparent;
  overflow-wrap: normal;
}

.article-body hr,
.prose hr {
  margin-block: 2.5em;
  border: 0;
  border-top: 1px solid var(--rule);
}

.article-aside {
  min-width: 0;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.article-aside p + p {
  margin-top: 15px;
}

.taxonomy {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.taxonomy a {
  padding: 5px 10px;
  border: 1px solid #bfc7b9;
  color: var(--accent-dark);
  font-size: 11px;
  text-decoration: none;
}

.taxonomy a:hover {
  border-color: var(--accent);
  background: #e4e9dc;
}

.article-end {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-top: 70px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
}

.article-end > * {
  min-width: 0;
  max-width: 48%;
}

.article-end > :last-child:not(:first-child) {
  text-align: right;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: clamp(32px, 6vw, 85px);
}

.about-layout > img,
.about-layout > picture img {
  width: 100%;
  object-fit: cover;
}

.contact-panel {
  max-width: 900px;
  padding-block: clamp(55px, 9vw, 130px);
}

.contact-panel h1 {
  max-width: 14ch;
}

.contact-panel p {
  max-width: 55ch;
  margin-top: 26px;
  color: var(--muted);
  font-size: 18px;
}

.contact-panel > a:not(.button) {
  display: inline-block;
  max-width: 100%;
  margin-top: 38px;
  font-family: var(--font-display);
  font-size: clamp(25px, 4vw, 43px);
}

.contact-panel .button {
  margin-top: 30px;
}

.filter-bar {
  margin-bottom: 20px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--rule);
}

.filter-bar form,
form.filter-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 13px;
}

.filter-bar label {
  display: block;
  flex: 1 1 260px;
  max-width: 620px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.search-input {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  padding: 11px 15px;
  border: 1px solid #a4aa9d;
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: #6c7268;
  opacity: 1;
}

.search-input:focus-visible {
  border-color: var(--accent);
  outline-offset: 2px;
}

.filter-status {
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding-block: 55px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  margin-top: var(--section-space);
  padding-block: 35px 43px;
  border-top: 1px solid var(--rule);
}

.quote-strip + .site-footer {
  margin-top: 0;
}

.site-footer .brand {
  font-size: 25px;
}

.site-footer p,
.site-footer nav {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.site-footer p a,
.site-footer nav a {
  display: inline-block;
  padding-block: 5px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

@media (min-width: 761px) {
  .menu > nav {
    display: flex !important;
  }
}

@media (max-width: 1000px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 36px;
  }

  .about-strip {
    gap: 32px;
  }
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    min-height: 112px;
    gap: 14px;
    padding-block: 23px;
  }

  .brand {
    font-size: 28px;
  }

  .brand-sub {
    max-width: 25ch;
    font-size: 10px;
    letter-spacing: 0.025em;
  }

  .menu {
    position: static;
    margin-top: 2px;
  }

  .menu-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #aab0a3;
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    list-style: none;
  }

  .menu-label::-webkit-details-marker {
    display: none;
  }

  .menu-label::after {
    content: "+";
    font-size: 17px;
    font-weight: 400;
  }

  .menu[open] .menu-label::after {
    content: "−";
  }

  .menu[open] nav {
    position: absolute;
    top: calc(100% - 10px);
    right: 0;
    left: 0;
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 12px 20px;
    border: 1px solid var(--rule);
    background: var(--paper);
    box-shadow: 0 15px 25px rgb(28 36 28 / 10%);
  }

  .menu nav a {
    min-height: 46px;
    padding: 12px 4px;
  }

  .hero {
    min-height: 520px;
    padding: 35px 27px;
    background-position: 58% center;
    background-image: linear-gradient(90deg, rgb(10 20 19 / 79%), rgb(10 20 19 / 35%)), linear-gradient(0deg, rgb(10 20 19 / 40%), transparent), var(--hero-image);
  }

  .hero h1 {
    font-size: clamp(47px, 8.8vw, 66px);
  }

  .hero-description {
    font-size: 16px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading h2 {
    font-size: 32px;
  }

  .section-heading > a {
    max-width: 33%;
    padding-top: 8px;
    font-size: 11px;
    text-align: right;
  }

  .post-grid {
    gap: 42px 24px;
  }

  .about-strip,
  .about-layout,
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .about-strip > img,
  .about-strip > picture img {
    max-height: 400px;
    aspect-ratio: 1.2;
  }

  .about-layout > img,
  .about-layout > picture img {
    max-height: 580px;
  }

  .article-aside {
    margin-top: 10px;
    padding-top: 25px;
  }

  .article-body,
  .prose {
    font-size: 16px;
    line-height: 1.85;
  }

  .article-cover img,
  img.article-cover {
    aspect-ratio: 1.4;
  }

  .contact-panel {
    padding-block: 45px 65px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    padding-block: 30px;
  }
}

@media (max-width: 520px) {
  .preview-bar {
    font-size: 10px;
    letter-spacing: 0.025em;
  }

  .hero {
    padding-inline: 23px;
  }

  .post-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 43px;
  }

  .image-link img {
    aspect-ratio: 1.5;
  }

  .post-card h3 {
    font-size: 29px;
  }

  .about-strip {
    padding: 25px;
  }

  .quote-strip {
    padding-inline: 5px;
  }

  .article-header h1 {
    font-size: 39px;
  }

  .article-end {
    flex-direction: column;
    gap: 20px;
  }

  .article-end > * {
    max-width: 100%;
  }

  .article-end > :last-child:not(:first-child) {
    text-align: left;
  }

  .filter-bar label {
    flex-basis: 100%;
  }
}

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

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

@media print {
  :root {
    --paper: #fff;
    --paper-deep: #fff;
    --ink: #000;
    --muted: #333;
    --rule: #bbb;
    --gutter: 0px;
    --section-space: 24pt;
  }

  @page {
    margin: 18mm;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }

  .preview-bar,
  .menu,
  .skip-link,
  .filter-bar,
  .filter-status,
  .article-aside,
  .hero .button {
    display: none !important;
  }

  .site-header {
    min-height: auto;
    padding-block: 0 18pt;
  }

  .hero {
    min-height: auto;
    padding: 22pt 0;
    background: none !important;
    color: #000;
  }

  .hero h1 {
    font-size: 36pt;
    text-shadow: none;
  }

  .hero .eyebrow,
  .hero-description {
    color: #333;
  }

  h1,
  .article-header h1 {
    font-size: 30pt;
  }

  h2 {
    font-size: 23pt;
  }

  h3 {
    font-size: 18pt;
  }

  .article-layout,
  .about-layout,
  .about-strip {
    display: block;
  }

  .article-body,
  .prose {
    max-width: none;
    font-size: 11pt;
    line-height: 1.65;
  }

  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24pt;
  }

  .about-strip {
    padding: 20pt 0;
  }

  .about-strip > img,
  .about-layout > img {
    width: 180pt;
    max-height: 180pt;
    margin-bottom: 18pt;
  }

  .article-cover img,
  img.article-cover {
    max-height: 250pt;
    object-fit: contain;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  h1,
  h2,
  h3,
  h4 {
    break-after: avoid;
  }

  img,
  figure,
  blockquote,
  .post-card {
    break-inside: avoid;
  }

  p,
  li {
    orphans: 3;
    widows: 3;
  }

  pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .site-footer {
    margin-top: 24pt;
    padding-block: 16pt 0;
  }
}
