/* ================================================================
   EASY SETTINGS: change a number, save, refresh.
   Each heading shrinks automatically on phones.
   ================================================================ */
:root {
  --headline-size: 92px; /* big hero: "Curiosity. Code. Repeat." (was 112px) */
  --heading-size: 42px; /* section headings: "Useful things. Interesting problems." etc. (was 58px) */
  --title-size: 29px; /* project titles: "Hozora", "GNotes"… */
  --text-size: 17px; /* normal body text */
}

:root {
  --paper: #f1efe7;
  --band: #e9e6dc; /* subtle shaded sections */
  --head: #faf8f2; /* header bar */
  --line-soft: #d6d6cc; /* light dividers */
  --ink: #22251f;
  --muted: #565a50;
  --line: #b8bbae;
  --orange: #b63b12;
  --dark: #222820;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px; /* room for the sticky header when jumping to #work etc. */
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    var(--text-size) / 1.6 Arial,
    Helvetica,
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 6px;
}
button {
  font: inherit;
}
.wrap {
  max-width: 1320px;
  margin: auto;
  padding: 0 6vw;
}
.mono {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}
.site-header {
  /* Full-width bar that stays at the top while scrolling. */
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--head);
  box-shadow: 0 1px 0 var(--line-soft);
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled {
  box-shadow:
    0 1px 0 var(--line-soft),
    0 10px 24px -14px rgba(20, 24, 18, 0.35);
}
.head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 22px;
  transition: padding 0.2s ease;
}
.site-header.scrolled .head-row {
  padding-block: 12px;
}
.brand {
  font-weight: 900;
  font-size: 25px;
  letter-spacing: -1px;
}
.brand i {
  font-style: normal;
  color: var(--orange);
}
nav {
  display: flex;
  gap: 28px;
  font-size: 13px;
}
section {
  padding: 78px 0;
}
.hero {
  padding: 75px 0 55px;
}
.eyebrow {
  display: flex;
  gap: 12px;
  align-items: center;
}
.dot {
  width: 8px;
  height: 8px;
  background: var(--orange);
  display: inline-block;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.9fr 1fr;
  gap: 5vw;
  align-items: end;
}
h1 {
  font-size: clamp(calc(var(--headline-size) * 0.54), 7.5vw, var(--headline-size));
  letter-spacing: -0.075em;
  line-height: 0.99;
  font-weight: 800;
  margin: 34px 0 38px;
}
h1 em {
  font-family: Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.065em;
}
h2 {
  font-size: clamp(calc(var(--heading-size) * 0.66), 4vw, var(--heading-size));
  letter-spacing: -0.055em;
  line-height: 1.08;
  margin: 12px 0 25px;
}
h3 {
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-size: var(--title-size);
  margin: 0 0 14px;
}
p {
  margin: 0 0 20px;
}
.hero-copy {
  max-width: 330px;
  padding-bottom: 38px;
}
.hero-copy p {
  font-size: 19px;
}
.arrow-link {
  display: inline-flex;
  gap: 40px;
  font-weight: bold;
  padding: 8px 0;
  border-bottom: 1px solid;
}
.hero-bottom {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.stamp {
  color: var(--orange);
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
  margin-bottom: 32px;
}
.section-head p {
  max-width: 470px;
  margin-top: 14px;
}
.projects {
  border-top: 1px solid var(--ink);
}
.project {
  display: grid;
  grid-template-columns: 65px 1fr 1.2fr 35px;
  gap: 25px;
  border-top: 1px solid var(--line);
  padding: 30px 0;
  align-items: start;
}
.project:last-child {
  border-bottom: 1px solid var(--line);
}
.project p {
  margin: 0;
  max-width: 420px;
}
.project h3 {
  margin-bottom: 7px;
}
.project > a:last-child {
  font-size: 30px;
  line-height: 1;
}
.tag {
  color: var(--orange);
}
.workbench {
  background: var(--dark);
  color: #f1efe7; /* always light text: this band is dark in both themes */
  padding: 68px 0;
}
.workbench .muted {
  color: #c1c9b8;
}
.workbench .mono {
  color: #cad5bd;
}
.lab-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 70px;
}
.lab-list {
  border-top: 1px solid #77816d;
}
.lab-list article {
  border-bottom: 1px solid #77816d;
  padding: 20px 0;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
}
.lab-list h3 {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin-bottom: 5px;
}
.lab-list p {
  font-size: 15px;
  color: #c1c9b8;
  margin: 0;
}
.cave {
  font-family: ui-monospace, monospace;
  line-height: 1.2;
  letter-spacing: 4px;
  white-space: pre;
  font-size: 24px;
  color: #e1e8be;
  background: #151b14;
  padding: 25px;
  margin: 28px 0 12px;
  overflow: hidden;
}
.cave .diamond {
  color: #fbc36b;
}
.lab-intro p {
  max-width: 440px;
}
.elsewhere-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.elsewhere-grid article {
  padding: 28px 28px 25px 0;
}
.elsewhere-grid article + article {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}
.elsewhere-grid h3 {
  font-size: 26px;
  margin: 24px 0 13px;
}
.elsewhere-grid p {
  font-size: 15px;
  color: var(--muted);
  max-width: 260px;
}
.symbol {
  height: 65px;
  margin: 28px 0 15px;
  display: flex;
  align-items: center;
}
.record {
  width: 64px;
  height: 64px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: repeating-radial-gradient(circle, var(--paper) 0 3px, var(--ink) 4px 5px);
  position: relative;
}
.record:after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: var(--orange);
  border: 3px solid var(--paper);
}
.film {
  height: 52px;
  width: 88px;
  border: 7px dotted var(--ink);
  border-left: 0;
  border-right: 0;
  background: var(--ink);
  box-shadow: inset 0 0 0 5px var(--paper);
}
.mountain svg {
  width: 110px;
  height: 65px;
}
.placeholder {
  font-size: 11px;
  color: var(--muted);
}
.about {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  border-top: 1px solid var(--line);
  padding-top: 55px;
}
.about p {
  max-width: 580px;
  font-size: 19px;
}
.small {
  font-size: 15px !important;
}
footer {
  display: flex;
  justify-content: space-between;
  padding: 26px 0 35px;
  border-top: 1px solid var(--ink);
}
footer a {
  font-size: 14px;
}
.theme {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.theme:hover {
  background: var(--ink);
  color: var(--paper);
}
body.night {
  --paper: #1d2025;
  --ink: #eceef1;
  --muted: #a7aeb9;
  --line: #4b525d;
  --orange: #ffb086;
  --dark: #141619;
  --band: #24272d;
  --head: #181b20;
  --line-soft: #333842;
}
.draft-note {
  font-size: 12px;
  margin-top: 14px;
  color: var(--muted);
}
@media (max-width: 750px) {
  .wrap {
    padding: 0 6vw;
  }
  nav {
    gap: 13px;
    font-size: 12px;
  }
  .hero-grid,
  .section-head,
  .lab-grid,
  .about {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  h1 {
    font-size: clamp(calc(var(--headline-size) * 0.52), 13vw, calc(var(--headline-size) * 0.78));
  }
  .hero {
    padding-top: 45px;
  }
  .hero-copy {
    max-width: 480px;
    padding: 0;
  }
  .hero-bottom {
    margin-top: 26px;
    gap: 20px;
    font-size: 10px;
  }
  section {
    padding: 50px 0;
  }
  .project {
    grid-template-columns: 25px 1fr 25px;
    gap: 12px;
  }
  .project p {
    grid-column: 2;
    grid-row: 2;
  }
  .project > a:last-child {
    grid-column: 3;
    grid-row: 1;
  }
  .project h3 {
    font-size: calc(var(--title-size) * 0.9);
  }
  .elsewhere-grid {
    grid-template-columns: 1fr;
  }
  .elsewhere-grid article + article {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
  }
  .elsewhere-grid article {
    display: grid;
    grid-template-columns: 1fr 100px;
  }
  .elsewhere-grid .symbol {
    grid-column: 2;
    grid-row: 1 / span 4;
    margin: auto;
  }
  .elsewhere-grid h3 {
    margin: 15px 0;
  }
  .elsewhere-grid p {
    max-width: none;
  }
  .placeholder {
    grid-column: 1;
  }
  .about {
    gap: 25px;
  }
  footer {
    gap: 20px;
    flex-wrap: wrap;
  }
  .cave {
    font-size: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Brief at first glance; fuller notes on demand. */
summary {
  cursor: pointer;
  width: fit-content;
  font-size: 13px;
  text-underline-offset: 4px;
  padding: 8px 0;
  color: var(--muted);
}
summary:hover {
  text-decoration: underline;
}
summary:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}
details[open] summary {
  margin-bottom: 8px;
}
.project-copy details p {
  font-size: 15px;
  color: var(--muted);
  padding-bottom: 5px;
}
.lab-list summary {
  color: #c1c9b8;
}
.lab-list article {
  padding: 26px 0;
}
.lab-list h3 {
  margin: 0;
}
.lab-list details p {
  margin-top: 5px;
}
.about-more {
  margin-bottom: 24px;
}
.about-more p {
  font-size: 16px;
}
.elsewhere-grid .placeholder {
  display: block;
  line-height: 1.7;
}
.section-head {
  margin-bottom: 24px;
}
@media (max-width: 750px) {
  .project-copy {
    grid-column: 2;
    grid-row: 2;
  }
  .project-copy p {
    grid-column: auto;
    grid-row: auto;
  }
  .elsewhere-grid .symbol {
    grid-row: 1 / span 3;
  }
}

/* Shared, responsive line-art illustrations for Elsewhere. */
.elsewhere-grid .symbol {
  height: 88px;
  margin: 23px 0 18px;
}
.symbol svg {
  display: block;
  height: 88px;
  width: auto;
  max-width: 100%;
  overflow: visible;
}
.listening-art svg {
  width: 128px;
}
.watching-art svg {
  width: 138px;
}
.mountain svg {
  width: 190px;
  height: 88px;
}
@media (max-width: 750px) {
  .elsewhere-grid article {
    grid-template-columns: minmax(0, 1fr) 140px;
    column-gap: 12px;
  }
  .elsewhere-grid .symbol {
    width: 140px;
    height: 80px;
    margin: auto;
    justify-content: center;
  }
  .elsewhere-grid .symbol svg {
    max-width: 140px;
    height: auto;
    max-height: 80px;
  }
  .elsewhere-grid .listening-art svg {
    width: 110px;
  }
  .elsewhere-grid .watching-art svg {
    width: 120px;
  }
}
@media (max-width: 380px) {
  .elsewhere-grid article {
    grid-template-columns: minmax(0, 1fr) 112px;
  }
  .elsewhere-grid .symbol {
    width: 112px;
  }
  .elsewhere-grid .symbol svg {
    max-width: 112px;
  }
}

#elsewhere {
  background: #e3e8dc;
  box-shadow: 0 0 0 100vmax #e3e8dc;
  clip-path: inset(0 -100vmax);
}
#elsewhere .symbol {
  --paper: #e3e8dc;
}
body.night #elsewhere {
  background: #2b323d;
  box-shadow: 0 0 0 100vmax #2b323d;
}
body.night #elsewhere .symbol {
  --paper: #2b323d;
}

/* Writing: post lists (home + blog index) */
#writing {
  border-top: 1px solid var(--line);
}
.post-list {
  border-top: 1px solid var(--ink);
  margin-bottom: 34px;
}
.post-row {
  display: grid;
  grid-template-columns: 130px 1fr 35px;
  gap: 25px;
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
  align-items: baseline;
}
.post-row h3 {
  font-size: 25px;
  margin: 0 0 6px;
}
.post-row p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  max-width: 620px;
}
.post-row .tags {
  color: var(--orange);
  margin-top: 8px;
  display: block;
}
.post-row > a:last-child {
  font-size: 24px;
  line-height: 1;
}
.post-empty {
  padding: 24px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.now-updated {
  display: block;
  margin-top: -10px;
  color: var(--muted);
}
.now-item {
  display: block;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
.now-item small {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.year {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 48px 0 0;
  padding-bottom: 10px;
}

/* Single post */
.post-head {
  padding: 70px 0 34px;
  border-bottom: 1px solid var(--ink);
}
.post-head h1 {
  font-size: clamp(42px, 6vw, 82px);
  margin: 22px 0 22px;
  max-width: 1000px;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.prose {
  max-width: 690px;
  padding: 46px 0 70px;
  font-size: 18px;
  line-height: 1.7;
}
.prose h2 {
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.04em;
  margin: 52px 0 16px;
}
.prose h3 {
  font-size: 24px;
  margin: 38px 0 12px;
}
.prose a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.prose img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 28px 0;
  border: 1px solid var(--line);
}
.prose ul,
.prose ol {
  padding-left: 22px;
  margin: 0 0 20px;
}
.prose li {
  margin-bottom: 6px;
}
.prose blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--orange);
  color: var(--muted);
}
.prose code {
  font-family: ui-monospace, monospace;
  font-size: 0.86em;
  background: rgba(127, 127, 110, 0.16);
  padding: 0.12em 0.35em;
}
.prose pre {
  background: #151b14;
  color: #e1e8be;
  padding: 20px 22px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
  margin: 26px 0;
}
.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 44px 0;
}
.prose table {
  border-collapse: collapse;
  margin: 26px 0;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}
.prose th,
.prose td {
  border-bottom: 1px solid var(--line);
  padding: 8px 14px 8px 0;
  text-align: left;
}
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid var(--ink);
  padding: 26px 0 60px;
  max-width: 690px;
}
.post-nav a {
  font-weight: bold;
}
.post-nav span {
  display: block;
  font-weight: normal;
}
@media (max-width: 750px) {
  .post-row {
    grid-template-columns: 1fr 25px;
    gap: 6px 12px;
  }
  .post-row > .mono:first-child {
    grid-column: 1 / -1;
  }
  .post-head {
    padding-top: 44px;
  }
  .prose {
    font-size: 17px;
  }
  .post-nav {
    flex-direction: column;
  }
}
.lab-list p {
  margin-top: 6px;
}
.bench-status {
  display: block;
  color: #ffb086 !important;
  margin-bottom: 4px;
}

/* Elsewhere: home cards + log page */
a.now-item {
  display: block;
  color: var(--ink);
  text-decoration: none;
}
a.now-item:hover strong {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.now-item strong {
  display: block;
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.now-by {
  display: block;
  font-size: 14px;
  color: var(--muted);
}
.now-note {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  color: var(--muted);
  margin-top: 8px;
}
.log-link {
  margin-top: 30px;
}
.log {
  border-top: 1px solid var(--ink);
}
.log-entry {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 25px;
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
  scroll-margin-top: 10px;
}
.log-entry:target {
  background: linear-gradient(90deg, transparent, rgba(182, 59, 18, 0.07));
}
.log-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.log-entry h3 {
  font-size: 24px;
  margin: 0 0 8px;
}
.log-by {
  font-weight: normal;
  font-size: 18px;
}
.log-entry p {
  max-width: 640px;
  margin: 0 0 14px;
  font-size: 16px;
}
.log-entry img {
  display: block;
  max-width: min(100%, 640px);
  height: auto;
  border: 1px solid var(--line);
  margin-top: 6px;
}
@media (max-width: 750px) {
  .log-entry {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .log-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
}
.log-body {
  max-width: 640px;
  font-size: 16px;
}
.log-body p {
  margin: 0 0 14px;
}
.log-body a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.log-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  margin: 14px 0;
}
.log-photos {
  display: grid;
  gap: 10px;
  max-width: 640px;
  margin-top: 6px;
}
.log-photos.multi {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.log-photos img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  margin: 0;
}
.log-photos.multi img {
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* Way back from subpages */
.back-link {
  display: inline-block;
  margin-top: 26px;
  font-size: 14px;
  font-weight: bold;
  padding: 6px 0;
}
main > .back-link + .hero,
main > .back-link + .post-head,
main > .back-link + article .post-head {
  padding-top: 34px;
}
.back-foot {
  padding: 10px 0 44px;
}
.back-foot .arrow-link {
  gap: 14px;
}

/* Selected work: live badge and link row */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 12px;
  color: var(--ink);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3f8a4a;
  box-shadow: 0 0 0 3px rgba(63, 138, 74, 0.18);
}
body.night .live-dot {
  background: #7fcf8a;
  box-shadow: 0 0 0 3px rgba(127, 207, 138, 0.2);
}
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 12px 0 2px;
  font-size: 14px;
  font-weight: bold;
}
.project-links a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.project-links a:hover {
  text-decoration: none;
  border-color: var(--ink);
}
.project-links .live-link {
  color: var(--orange);
  border-color: currentColor;
}
.project-links .live-link .mono {
  font-weight: normal;
  color: var(--muted);
  margin-left: 8px;
  text-transform: none;
  letter-spacing: 0.02em;
}
@media (prefers-reduced-motion: no-preference) {
  .live-dot {
    animation: livepulse 2.4s ease-in-out infinite;
  }
}
@keyframes livepulse {
  50% {
    box-shadow: 0 0 0 6px rgba(63, 138, 74, 0);
  }
}

@media (max-width: 750px) {
  .head-row {
    padding-block: 16px;
  }
  .site-header.scrolled .head-row {
    padding-block: 10px;
  }
  html {
    scroll-padding-top: 80px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-header,
  .head-row,
  a {
    transition: none !important;
  }
}

/* ================================================================
   REFINEMENTS
   Fewer lines, shaded sections, and a quieter hover on links.
   ================================================================ */

/* Links: no underline on hover. Instead the text gets a little
   bolder and bigger (done without nudging the layout around). */
a:hover {
  text-decoration: none;
}
nav a,
footer a,
.brand,
.back-link,
.arrow-link,
.project h3 a,
.post-row h3 a,
.project-links a,
.post-nav a,
.lab-list h3 a {
  display: inline-block;
  transition:
    transform 0.15s ease,
    -webkit-text-stroke-width 0.15s ease;
  -webkit-text-stroke: 0 currentColor;
}
nav a,
.brand {
  transform-origin: center;
}
.back-link,
.arrow-link,
.project h3 a,
.post-row h3 a,
.project-links a,
.post-nav a,
.lab-list h3 a,
footer a {
  transform-origin: left center;
}
nav a:hover,
footer a:hover,
.brand:hover,
.back-link:hover,
.arrow-link:hover,
.project h3 a:hover,
.post-row h3 a:hover,
.project-links a:hover,
.post-nav a:hover,
.lab-list h3 a:hover {
  transform: scale(1.06);
  -webkit-text-stroke: 0.025em currentColor;
}
a.now-item strong {
  display: inline-block;
  transition: transform 0.15s ease;
  transform-origin: left center;
}
a.now-item:hover strong {
  text-decoration: none;
  transform: scale(1.04);
  -webkit-text-stroke: 0.025em currentColor;
}
/* Links inside written text keep their underline, so they still read as links. */
.prose a:hover,
.log-body a:hover {
  text-decoration: underline;
}
/* Current page in the menu: orange and bold, no underline. */
nav a[aria-current="page"] {
  color: var(--orange);
  font-weight: bold;
}

/* Header: make the brand a touch bigger so the bar has some weight. */
.brand {
  font-size: 27px;
}

/* Shaded sections, full window width. Order down the home page:
   intro (paper) · work (shaded) · workbench (dark) · elsewhere (green)
   · writing (paper) · about (shaded). */
#work,
#about {
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  clip-path: inset(0 -100vmax);
}
#about {
  padding: 70px 0;
}
section {
  padding: 70px 0;
}
.hero {
  padding: 64px 0 56px;
}

/* Fewer lines: drop the heavy rules between sections and keep only
   light dividers between items in a list. */
.hero-bottom,
.projects,
#writing,
.about,
footer {
  border-top: 0;
}
.project {
  border-top: 0;
}
.project + .project {
  border-top: 1px solid var(--line-soft);
}
.project:last-child {
  border-bottom: 0;
}
.elsewhere-grid {
  border-top: 0;
  border-bottom: 0;
}
.elsewhere-grid article + article {
  border-left-color: var(--line-soft);
}
.lab-list {
  border-top: 0;
}
.lab-list article:last-of-type {
  border-bottom: 0;
}
.post-list {
  border-top: 0;
}
.post-row:last-child {
  border-bottom: 0;
}
.post-row {
  border-bottom-color: var(--line-soft);
}
.log {
  border-top: 0;
}
.log-entry {
  border-bottom-color: var(--line-soft);
}
.log-entry:last-child {
  border-bottom: 0;
}
.post-head {
  border-bottom-color: var(--line-soft);
}
.post-nav {
  border-top-color: var(--line-soft);
}
footer {
  margin-top: 0;
  padding-top: 30px;
}

@media (max-width: 750px) {
  .elsewhere-grid article + article {
    border-top-color: var(--line-soft);
  }
  section,
  #about {
    padding: 48px 0;
  }
  .brand {
    font-size: 24px;
  }
}
.post-empty {
  border-bottom: 0;
}

/* Phone header: logo on the first row, menu on its own row underneath. */
@media (max-width: 750px) {
  .head-row {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .head-row nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .site-header.scrolled .brand {
    font-size: 20px;
  }
  html {
    scroll-padding-top: 110px;
  }
}

/* ================================================================
   NO LINES
   Sections are told apart by shading and space, items by space alone.
   (Lines inside written posts, such as tables and quotes, are kept.)
   ================================================================ */
.site-header {
  box-shadow: none;
}
.site-header.scrolled {
  box-shadow: 0 10px 24px -14px rgba(20, 24, 18, 0.35);
}
.arrow-link {
  border-bottom: 0;
  padding: 6px 0;
  gap: 10px;
  color: var(--orange);
}
.workbench .arrow-link {
  color: #ffb086;
}
.project + .project,
.project:last-child,
.project-links a,
.lab-list article,
.lab-list article:last-of-type,
.post-row,
.log-entry,
.post-head,
.post-nav {
  border: 0;
}
.elsewhere-grid article + article {
  border-left: 0;
  border-top: 0;
}
.project {
  padding: 26px 0;
}
.lab-list article {
  padding: 18px 0;
}
.post-row,
.log-entry {
  padding: 22px 0;
}
.project-links {
  gap: 6px 18px;
}
.project-links a {
  padding-bottom: 0;
}

/* ================================================================
   THEME SWITCH: round icon in the header (moon in light mode, sun in dark).
   ================================================================ */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.3s ease;
}
.theme-toggle:hover {
  background: var(--band);
  transform: rotate(-15deg) scale(1.08);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.theme-toggle svg {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    opacity 0.25s ease,
    transform 0.35s ease;
}
.theme-toggle .icon-moon {
  fill: currentColor;
  stroke: none;
}
.theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}
body.night .theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}
body.night .theme-toggle .icon-sun {
  opacity: 1;
  transform: none;
  color: #ffd27a;
}
.head-row nav {
  margin-left: auto;
}
@media (max-width: 750px) {
  /* Logo and switch on the first row, menu underneath. */
  .head-row .brand {
    order: 1;
  }
  .theme-toggle {
    order: 2;
    margin-left: auto;
    width: 34px;
    height: 34px;
  }
  .head-row nav {
    order: 3;
    margin-left: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle svg {
    transition: none;
  }
}

/* ================================================================
   DARK MODE: charcoal and slate (no green). The light-mode colours above
   are unchanged; these only apply when dark mode is on.
   ================================================================ */
body.night .workbench .muted,
body.night .lab-list p,
body.night .lab-list summary {
  color: #b4bbc6;
}
body.night .workbench .mono {
  color: #c3c9d3;
}
body.night .cave {
  background: #0f1114;
  color: #dfe3ea;
}
body.night .live-dot {
  background: #7fd1a0;
}

/* ================================================================
   PRIVATE LAUNCHER (/go/)
   ================================================================ */
.go-page {
  padding-block: 56px 80px;
}
.go-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 26px;
}
.go-tile {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 22px 22px 18px;
  background: var(--band);
  border-radius: 10px;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease;
}
.go-tile:hover {
  transform: translateY(-3px);
  background: var(--head);
}
.go-tile strong {
  font-size: 22px;
  letter-spacing: -0.03em;
}
.go-note {
  font-size: 14px;
  color: var(--muted);
}
.go-host {
  margin-top: 10px;
  color: var(--orange);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0.02em;
}
.go-key {
  position: absolute;
  top: 14px;
  right: 16px;
  color: var(--muted);
}
.go-hint {
  margin-top: 26px;
}
@media (hover: none) {
  .go-key,
  .go-hint {
    display: none;
  }
}

/* Launcher: locked page, header icon and dropdown (only shown once unlocked). */
.go-nothing {
  display: none;
  font-size: 18px;
  margin: 40px 0;
}
body.go-locked .go-nothing {
  display: block;
}
body.go-locked .go-content {
  display: none;
}
.icon-btn.launch-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.launch-btn + .theme-toggle {
  margin-left: 4px;
}
.icon-btn.launch-btn:hover,
.launch-btn[aria-expanded="true"] {
  background: var(--band);
}
.launch-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.head-row {
  position: relative;
}
.launch-menu {
  position: absolute;
  top: calc(100% - 4px);
  right: 0;
  z-index: 30;
  display: grid;
  width: min(300px, calc(100vw - 32px));
  padding: 8px;
  background: var(--head);
  border-radius: 10px;
  box-shadow: 0 16px 40px -12px rgba(15, 18, 22, 0.35);
}
.launch-menu a {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 7px;
  transform: none !important;
  -webkit-text-stroke: 0 !important;
}
.launch-menu a:hover {
  background: var(--band);
}
.launch-menu strong {
  font-size: 15px;
}
.launch-menu span {
  font: 12px ui-monospace, monospace;
  color: var(--muted);
}
.launch-menu .launch-all {
  margin-top: 4px;
  font-size: 13px;
  color: var(--orange);
}
.launch-menu[hidden] {
  display: none;
}
@media (max-width: 750px) {
  .icon-btn.launch-btn {
    order: 2;
    margin-left: auto;
    width: 34px;
    height: 34px;
  }
  .launch-btn + .theme-toggle {
    margin-left: 2px;
  }
}
