@font-face { font-family: 'ET Book'; font-style: normal; font-weight: 400; src: url('https://cdn.jsdelivr.net/gh/edwardtufte/et-book/et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff') format('woff'); font-display: swap; }


  :root {
    --bg: #FCFBF7; --fg: #060606; --faded: #5B5F66; --border: #E6E3DC; --accent: #E34234;
    --hover: #F4F1EA;
    --serif: 'Newsreader', Georgia, serif;
    --display: 'Cormorant Garamond', Georgia, serif;
    --mono: 'Spline Sans Mono', 'Menlo', monospace;
    --wt-display: 700; --wt-body: 400;
  }
  :root[data-theme="alt"] { --bg: #0A0D0B; --fg: #F6F7F5; --faded: #7C817E; --border: #1E211F; --accent: #E34234; --hover: #131614; }
  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }
  body { background: var(--bg); color: var(--fg); font-family: var(--serif); line-height: 1.5; overflow-x: hidden; transition: background 0.4s, color 0.4s; }
  a { color: inherit; text-decoration: none; }

  header { padding: 16px 24px 16px 16px; border-bottom: 1px solid var(--fg); position: sticky; top: 0; background: var(--bg); z-index: 100; transition: background 0.4s; display: flex; align-items: center; justify-content: space-between; }
  .logo { font-family: var(--display); font-weight: 500; font-size: 2.7rem; line-height: 1; letter-spacing: 0; cursor: pointer; display: inline-block; }
  header { transition: background 0.4s, padding 0.3s; }
  .mast-link { display: inline-flex; align-items: center; color: var(--fg); text-decoration: none; cursor: pointer; }
  .mast-stacked { display: inline-flex; align-items: center; gap: 0; }
  .mast-stacked .stack { margin-left: -6px; }
  .mast-single { display: none; align-items: center; gap: 11px; }
  #masthead.scrolled .mast-stacked { display: none; }
  #masthead.scrolled .mast-single { display: inline-flex; }
  #masthead.scrolled { padding-top: 14px; padding-bottom: 14px; }
  .mg { width: 132px; height: 132px; display: block; color: var(--fg); flex-shrink: 0; }
  .mg-sm { width: 34px; height: 34px; display: block; color: var(--fg); flex-shrink: 0; }
  .stack { display: inline-flex; flex-direction: column; align-items: center; }
  .stack .w { font-family: var(--display); font-weight: 600; font-size: 1.8rem; line-height: 0.92; letter-spacing: 0.005em; text-align: center; }
  .stack .of { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 0.95rem; color: var(--accent); text-align: center; line-height: 1.7; }
  .single-wm { font-family: var(--display); font-weight: 500; font-size: 1.5rem; line-height: 1; }
  .wof { font-style: italic; color: var(--accent); font-size: 0.8em; }

  .grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; padding: 30px; max-width: 1200px; margin-inline: auto; }
  .plate { border: 1px solid var(--border); padding: 30px; display: flex; flex-direction: column; position: relative; overflow: hidden; transition: background-color 0.3s ease, border-color 0.3s ease; min-height: 360px; }
  .plate.held { background-color: var(--hover); border-color: var(--faded); }

  .feat { position: relative; width: calc(100% + 60px); margin: -30px -30px 26px; aspect-ratio: 16 / 9; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--field, #d8d3ca); }
  .feat img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s cubic-bezier(0.19,1,0.22,1); }
  @media (hover: hover){ .plate:hover .feat img { transform: scale(1.04); } }
  .feat svg { width: 78%; height: 76%; opacity: 1; fill: none; transition: transform 0.5s cubic-bezier(0.19,1,0.22,1); will-change: transform; }
  .feat svg .solid { stroke: rgba(20,16,12,0.7); stroke-width: 1.2; }
  .feat svg .dash { stroke: rgba(20,16,12,0.55); stroke-width: 1.2; stroke-dasharray: 4 5; }
  .feat svg .node { fill: rgba(20,16,12,0.85); stroke: none; }
  .feat svg .mod { fill: rgba(20,16,12,0.82); stroke: none; }

  .plate-title { font-family: var(--display); font-weight: var(--wt-display); font-size: clamp(1.85rem, 3vw, 2.5rem); line-height: 1.08; letter-spacing: 0; margin-bottom: 18px; }


  .plate-dek { font-family: var(--serif); font-style: normal; font-weight: var(--wt-body); font-size: 1.05rem; line-height: 1.42; color: var(--faded); margin-bottom: 24px; }
  .article-lead { width: 100%; aspect-ratio: 3 / 2; overflow: hidden; background: var(--field, #d8d3ca); border: 1px solid var(--border); margin-bottom: 30px; }
  .article-lead img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .article { max-width: 720px; margin: 0 auto; padding: 6px 30px 24px; box-sizing: border-box; }
  .article-title { font-family: var(--display); font-weight: var(--wt-display); font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.08; margin-bottom: 16px; }
  .article-sub { font-family: var(--serif); font-style: normal; font-weight: var(--wt-body); font-size: 1.7rem; line-height: 1.4; color: var(--fg); opacity: 0.78; margin-bottom: 26px; }
  .article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; font-family: var(--mono); border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 34px; }
  .ameta-name { font-family: var(--mono); font-weight: 500; font-size: 0.96rem; color: var(--fg); text-decoration: none; }
  .ameta-sep { color: var(--faded); font-size: 0.82rem; }
  .ameta-date, .ameta-share { font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0; text-transform: none; color: var(--faded); }
  .ameta-share { appearance: none; background: none; border: none; padding: 0; cursor: pointer; transition: color 0.2s; }
  .ameta-share:hover { color: var(--accent); }
  .article-body p { font-family: var(--serif); font-weight: var(--wt-body); font-size: 1.2rem; line-height: 1.62; margin-bottom: 20px; }
  .article-body > p:first-of-type::first-letter { float: left; font-family: var(--display); font-weight: var(--wt-display); font-size: 3.6em; line-height: 0.78; padding: 0.04em 0.08em 0 0; color: var(--accent); }
  .article-body h2 { font-family: var(--display); font-weight: var(--wt-display); font-size: 2.1rem; line-height: 1.1; margin: 48px 0 16px; }
  .article-body h3 { font-family: var(--display); font-weight: var(--wt-display); font-size: 1.55rem; line-height: 1.16; margin: 34px 0 12px; }
  .article-body h4 { font-family: var(--display); font-weight: var(--wt-display); font-style: italic; font-size: 1.24rem; line-height: 1.2; margin: 28px 0 8px; }
  .article-body a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent); transition: opacity 0.2s; }
  .article-body a:hover { opacity: 0.6; }


  footer { padding: 44px 30px; border-top: 1px solid var(--fg); }
  .colophon { display: flex; flex-direction: column; align-items: flex-start; gap: 56px; }
  .footer-brand { display: flex; align-items: center; gap: 8px; }
  .mg-foot { width: 52px; height: 52px; display: block; color: var(--fg); flex-shrink: 0; }
  .footer-wm { font-family: var(--display); font-weight: 500; font-size: 1.6rem; line-height: 1; }
  .footer-brand .sub { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 0.9rem; margin-top: 10px; color: var(--faded); }
  .footer-credits { display: flex; flex-direction: column; align-self: flex-start; align-items: flex-start; text-align: left; gap: 6px; }
  .credit-line { font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em; color: var(--faded); display: inline-flex; align-items: center; gap: 7px; }
  .byline { font-family: 'ET Book', Georgia, serif; font-size: 11px; color: var(--fg); }
  .byline .ast { font-family: 'ET Book', Georgia, serif; color: #c09058; font-size: 0.62em; vertical-align: 0.3em; margin-left: 1px; }
  .mcf-mini { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--fg); padding: 4px 8px; font-family: 'JetBrains Mono', monospace; font-size: 8px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg); background: transparent; line-height: 1; transition: background 0.12s, color 0.12s; }
  .mcf-mini:hover { background: var(--fg); color: var(--bg); }
  .mcf-mini:hover .mcf-sigil { background: var(--bg); }
  .mcf-mini .mcf-sigil { width: 6px; height: 6px; background: var(--fg); display: inline-block; flex-shrink: 0; }
  .footer-toggle { margin-top: 18px; width: 26px; height: 26px; appearance: none; padding: 0; border: 1px solid var(--fg); background: transparent; color: var(--fg); display: flex; align-items: center; justify-content: center; opacity: 0.6; transition: opacity 0.2s; cursor: pointer; }
  .footer-toggle:hover { opacity: 1; }

  /* Hamburger + full-page menu overlay */
  .menu-btn { appearance: none; background: none; border: none; padding: 8px; margin: -8px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; z-index: 1600; }
  .menu-btn span { display: block; width: 26px; height: 1.5px; background: var(--fg); transition: transform 0.3s, opacity 0.3s; }
  body.menu-open .menu-btn span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  body.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
  body.menu-open .menu-btn span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  body.menu-open { overflow: hidden; }

  .menu-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 2000; display: flex; flex-direction: column; padding: 26px 30px 30px; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity 0.4s, transform 0.4s, visibility 0.4s; overflow-y: auto; }
  body.menu-open .menu-overlay { opacity: 1; visibility: visible; transform: none; }
  body.menu-open { overflow: hidden; }
  .menu-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--fg); padding-bottom: 22px; flex-shrink: 0; }
  .menu-logo { font-family: var(--display); font-size: 1.7rem; line-height: 1; color: var(--fg); cursor: pointer; display: inline-flex; align-items: center; gap: 11px; }
  .mg-bar { width: 34px; height: 34px; display: block; color: var(--fg); flex-shrink: 0; }
  .menu-close { appearance: none; background: none; border: none; font-family: var(--display); font-size: 2.4rem; line-height: 1; color: var(--fg); cursor: pointer; padding: 0 4px; }
  .menu-body { flex: 1; display: flex; align-items: flex-start; padding: 6vh 0; }

  .menu-primary { width: 100%; display: flex; flex-direction: column; gap: 4px; }
  .mlink { font-family: var(--display); font-weight: 500; font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.1; color: var(--fg); cursor: pointer; transition: color 0.2s; }
  .mlink:hover { color: var(--accent); }
  .mtopics { width: 100%; }
  .mtopics-toggle { appearance: none; background: none; border: none; width: 100%; padding: 4px 0; margin: 0; text-align: left; display: flex; align-items: baseline; gap: 16px; cursor: pointer; color: var(--fg); }
  .mtopics-mark { font-family: var(--mono); font-size: 0.34em; font-weight: 400; color: var(--accent); transition: transform 0.32s cubic-bezier(0.16,1,0.3,1); display: inline-block; transform-origin: center; }
  .mtopics.open .mtopics-mark { transform: rotate(45deg); }
  .topics-panel { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.42s cubic-bezier(0.16,1,0.3,1), opacity 0.3s ease; }
  .mtopics.open .topics-panel { max-height: 500px; opacity: 1; }
  .topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; padding: 24px 0 10px 6px; max-width: 540px; }
  .topic-grid a { font-family: var(--serif); font-size: 1.35rem; color: var(--fg); cursor: pointer; position: relative; padding-left: 24px; transition: color 0.2s; }
  .topic-grid a::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
  .topic-grid a:hover { color: var(--accent); }


  @media (max-width: 600px){
    .grid { grid-template-columns: 1fr; }
  }

  @media (max-width: 768px){
    .menu-overlay { padding: 18px; }
    .menu-bar { padding-bottom: 16px; }
    .menu-logo { font-size: 1.5rem; }
    .menu-body { padding: 5vh 0; }
    .mlink { font-size: clamp(2.4rem, 13vw, 3.4rem); }
    .topic-grid { grid-template-columns: 1fr 1fr; gap: 12px 20px; }
    .topic-grid a { font-size: 1.15rem; }
    .article-sub { font-size: 1.4rem; }
    .article { padding-left: 20px; padding-right: 20px; }
    .article-body p { font-size: 1.1rem; }
    .article-body h2 { font-size: 1.62rem; }
    .article-body h3 { font-size: 1.32rem; }
    header { padding: 14px 16px 14px 10px; }
    .mg { width: 104px; height: 104px; }
    .stack .w { font-size: 1.5rem; }
    .stack .of { font-size: 0.85rem; }
    .grid { gap: 16px; padding: 18px; }
    .plate { padding: 24px; min-height: 0; }
    footer { padding: 36px 18px; }
    .colophon { flex-direction: column; align-items: flex-start; gap: 26px; }
    .footer-credits { align-self: flex-start; align-items: flex-start; text-align: left; }
    .mg-foot { width: 44px; height: 44px; }
    .footer-wm { font-size: 1.4rem; }
  }

/* ---- Search view ---- */
.search-wrap { max-width: 720px; margin: 0 auto; padding: 6px 30px 48px; box-sizing: border-box; }
.search-heading { font-family: var(--display); font-weight: var(--wt-display); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; margin-bottom: 18px; }
.search-field { border-bottom: 2px solid var(--fg); margin-bottom: 14px; }
.search-input { width: 100%; appearance: none; background: none; border: none; outline: none; color: var(--fg); font-family: var(--serif); font-weight: var(--wt-body); font-size: 1.5rem; line-height: 1.3; padding: 6px 2px 12px; }
.search-input::placeholder { color: var(--faded); opacity: 1; }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-count { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faded); margin-bottom: 26px; }
.search-results { display: flex; flex-direction: column; }
.search-result { display: flex; gap: 18px; align-items: flex-start; width: 100%; text-align: left; appearance: none; background: none; border: none; border-bottom: 1px solid var(--border); padding: 22px 0; color: var(--fg); cursor: pointer; transition: opacity 0.15s; }
.search-result.nolink { cursor: default; }
@media (hover: hover){ .search-result:not(.nolink):hover { opacity: 0.62; } }
.search-thumb { width: 104px; height: 68px; flex-shrink: 0; overflow: hidden; background: var(--field, #d8d3ca); border: 1px solid var(--border); }
.search-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.search-text { flex: 1; min-width: 0; }
.search-title { display: block; font-family: var(--display); font-weight: var(--wt-display); font-size: 1.45rem; line-height: 1.1; margin-bottom: 6px; }
.search-dek { display: block; font-family: var(--serif); font-style: italic; font-weight: var(--wt-body); font-size: 1.02rem; line-height: 1.4; color: var(--faded); }
.search-empty { font-family: var(--serif); font-style: italic; color: var(--faded); font-size: 1.1rem; padding: 12px 0; }
@media (max-width: 768px){
  .search-wrap { padding-left: 20px; padding-right: 20px; }
  .search-input { font-size: 1.3rem; }
  .search-thumb { width: 80px; height: 54px; }
  .search-title { font-size: 1.2rem; }
}
