:root {
  color-scheme: light;
  --paper: #f7f1e4;
  --paper-soft: #efe3cf;
  --paper-card: rgba(255, 252, 244, 0.94);
  --ink: #25211b;
  --muted: #74695a;
  --line: rgba(37, 33, 27, 0.16);
  --line-strong: rgba(37, 33, 27, 0.34);
  --shadow: 0 18px 48px rgba(78, 59, 38, 0.12);
  --sumi: #1f2f2d;
  --moss: #6f8062;
  --petal: #d9919e;
  --sea: #7398a0;
  --sky: #9ebdc5;
  --foam: #f4f0df;
  --sand: #d7be8f;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Fraunces", Georgia, serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161813;
  --paper-soft: #0f1515;
  --paper-card: rgba(31, 34, 27, 0.96);
  --ink: #f1ead7;
  --muted: #b7aa91;
  --line: rgba(241, 234, 215, 0.15);
  --line-strong: rgba(241, 234, 215, 0.34);
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.34);
  --sumi: #d9eadb;
  --moss: #9caf76;
  --petal: #df8aa0;
  --sea: #82bac5;
  --sky: #77aebf;
  --foam: #f6edd4;
  --sand: #b79864;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 6rem;
  scroll-behavior: smooth;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 520ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 12%, rgba(217, 145, 158, 0.2), transparent 24rem),
    radial-gradient(circle at 85% 20%, rgba(115, 152, 160, 0.22), transparent 28rem),
    linear-gradient(180deg, var(--paper), #fbf8ef 55%, var(--paper-soft));
  color: var(--ink);
  font-family: var(--mono);
  overflow-x: hidden;
  position: relative;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 18% 14%, rgba(169, 79, 105, 0.18), transparent 26rem),
    radial-gradient(circle at 82% 22%, rgba(47, 104, 119, 0.28), transparent 30rem),
    linear-gradient(180deg, var(--paper), #11140f 55%, var(--paper-soft));
}

body::before {
  background-image:
    linear-gradient(rgba(37, 33, 27, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 33, 27, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(180deg, #000, transparent 78%);
  opacity: 0.22;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

[data-theme="dark"] body::before {
  background-image:
    linear-gradient(rgba(241, 234, 215, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 234, 215, 0.025) 1px, transparent 1px);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

#petals {
  inset: 0;
  opacity: 0.48;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

body.motion-paused #petals {
  opacity: 0.12;
}

.site-header {
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(247, 241, 228, 0.74);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr auto;
  left: 0;
  min-height: 68px;
  padding: 0 clamp(1.1rem, 4vw, 3rem);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 10;
}

[data-theme="dark"] .site-header {
  background: rgba(22, 24, 19, 0.78);
}

.identity {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 650;
}

nav {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
}

nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.45rem 0.8rem;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

nav a:hover,
nav a.active {
  background: var(--paper-card);
  border-color: var(--line);
  color: var(--ink);
  transform: translateY(-1px);
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.header-social,
.site-controls {
  display: flex;
  gap: 0.45rem;
}

.header-social a,
.icon-link,
.control-button {
  align-items: center;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(78, 59, 38, 0.08);
  color: var(--ink);
  display: inline-flex;
  justify-content: center;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.header-social a {
  height: 2.25rem;
  width: 2.25rem;
}

.control-button {
  cursor: pointer;
  font-size: 0.72rem;
  min-height: 2.25rem;
  padding: 0 0.78rem;
}

.control-button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.header-social svg,
.icon-link svg {
  fill: none;
  height: 1.1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  width: 1.1rem;
}

.header-social a:nth-child(2) svg,
.header-social a:nth-child(3) svg,
.icon-link.github svg,
.icon-link.linkedin svg {
  fill: currentColor;
  stroke: none;
}

.header-social a:hover,
.icon-link:hover,
.control-button:hover {
  border-color: var(--ink);
  box-shadow: 0 14px 28px rgba(78, 59, 38, 0.16);
  transform: translateY(-2px);
}

.hero {
  align-items: center;
  display: grid;
  gap: clamp(2rem, 8vw, 7rem);
  grid-template-columns: minmax(0, 0.84fr) minmax(18rem, 1fr);
  min-height: 100svh;
  padding: 7rem clamp(1.2rem, 6vw, 6rem) 4rem;
  position: relative;
  z-index: 3;
}

.eyebrow,
.work-item span,
figcaption {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

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

h1,
h2 {
  font-family: var(--serif);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 0.98;
}

h1 {
  font-size: clamp(2.8rem, 5.65vw, 5.9rem);
  max-width: 13.2ch;
  overflow-wrap: normal;
}

h2 {
  font-size: clamp(2.5rem, 7vw, 6.8rem);
}

h3 {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  line-height: 1.1;
}

p {
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  line-height: 1.75;
}

.hero-details {
  grid-column: 1;
}

.hero-details p {
  max-width: 37rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--shadow);
  display: inline-flex;
  min-height: 2.75rem;
  padding: 0 1.1rem;
}

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

.quiet-scene {
  grid-column: 2;
  grid-row: 1 / 3;
  margin: 0;
  min-width: 0;
}

pre {
  color: var(--sumi);
  font-family: var(--mono);
  font-size: clamp(0.42rem, 0.85vw, 0.76rem);
  line-height: 1.05;
  margin: 0;
  overflow: hidden;
  white-space: pre;
}

#sakura-ascii {
  color: var(--sumi);
  filter: drop-shadow(0 20px 45px rgba(79, 62, 39, 0.12));
}

#sakura-ascii .bark {
  color: #765036;
}

#sakura-ascii .dark-bark {
  color: #42291d;
}

#sakura-ascii .bark-light {
  color: #9b6a47;
}

#sakura-ascii .petal {
  color: #c9798d;
}

#sakura-ascii .petal-deep {
  color: #9e3f5d;
}

#sakura-ascii .petal-light {
  color: #e7b7c0;
}

#sakura-ascii .petal-mist {
  color: #f5cfd7;
}

#sakura-ascii .leaf {
  color: #7f8f68;
}

#sakura-ascii .leaf-light {
  color: #a6ad78;
}

figcaption {
  margin-top: 1rem;
}

.river {
  height: auto;
  position: relative;
  z-index: 3;
}

.river-sticky {
  height: auto;
  overflow: visible;
  position: static;
}

.river-track {
  display: block;
  height: auto;
  transform: none;
}

.river-panel {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: clamp(1.5rem, 4vw, 4rem);
  grid-template-columns: minmax(12rem, 0.55fr) minmax(0, 1fr);
  min-height: 100svh;
  overflow: hidden;
  padding: 7rem clamp(1.2rem, 6vw, 6rem) 4rem;
  scroll-margin-top: 5.5rem;
}

.section-heading {
  align-self: start;
}

.profile-panel {
  align-items: start;
  grid-template-columns: minmax(20rem, 0.78fr) minmax(30rem, 1fr);
  grid-template-rows: auto 1fr;
}

.profile-panel .section-heading {
  grid-column: 1;
  grid-row: 1;
}

.profile-text {
  grid-column: 1;
  grid-row: 2;
  max-width: 42rem;
}

.profile-panel .soft-ascii {
  align-self: center;
  grid-column: 2;
  grid-row: 1 / 3;
}

.soft-ascii,
.wave-ascii {
  align-self: stretch;
  display: block;
  justify-self: stretch;
  line-height: 1.01;
  min-height: min(58vh, 34rem);
  min-width: 0;
  opacity: 0.96;
  overflow: visible;
  width: 100%;
}

.soft-ascii {
  color: var(--moss);
  font-size: clamp(0.28rem, 0.52vw, 0.48rem);
}

.soft-ascii .sky {
  color: var(--sky);
}

.soft-ascii .cloud {
  color: rgba(128, 162, 170, 0.62);
}

.soft-ascii .gate {
  color: #b65d4b;
}

.soft-ascii .gate-dark {
  color: #7c2827;
}

.soft-ascii .gate-light {
  color: #df7b65;
}

.soft-ascii .roof {
  color: #47342d;
}

.soft-ascii .stone {
  color: #8d836f;
}

.soft-ascii .grass {
  color: #75835d;
}

.soft-ascii .flower {
  color: #d9919e;
}

.soft-ascii .water {
  color: #5eaebc;
}

.soft-ascii .water-light {
  color: #92cbd6;
}

.soft-ascii .water-deep {
  color: #27525f;
}

.soft-ascii .crest {
  color: #e5f6f8;
}

.wave-ascii {
  font-size: clamp(0.28rem, 0.48vw, 0.45rem);
  overflow: hidden;
}

.wave-ascii .crest {
  color: var(--foam);
  text-shadow: 0 0 10px rgba(255, 249, 234, 0.65);
}

.wave-ascii .water-light {
  color: #94bbc3;
}

.wave-ascii .water {
  color: #5f99a7;
}

.wave-ascii .water-deep {
  color: #2f6877;
}

.wave-ascii .sand {
  color: #c5a975;
}

.work-list {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: none;
  overflow: visible;
  padding: 0;
}

.work-item,
.contact-card {
  backdrop-filter: blur(12px);
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 2vw, 1.6rem);
}

.work-item {
  display: flex;
  flex-direction: column;
  min-height: 13rem;
  position: relative;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.work-item.featured {
  background:
    linear-gradient(135deg, rgba(217, 145, 158, 0.2), rgba(255, 252, 244, 0.82) 48%, rgba(115, 152, 160, 0.18)),
    var(--paper-card);
  border-color: rgba(169, 79, 105, 0.34);
  grid-column: 1 / -1;
}

.work-item.featured span {
  color: #a94f69;
}

[data-theme="dark"] .work-item.featured {
  background:
    linear-gradient(135deg, rgba(169, 79, 105, 0.26), rgba(31, 34, 27, 0.92) 48%, rgba(47, 104, 119, 0.22)),
    var(--paper-card);
}

.work-item:hover {
  background: rgba(255, 252, 244, 0.98);
  border-color: var(--line-strong);
  transform: translateY(-4px);
}

[data-theme="dark"] .work-item:hover {
  background: rgba(39, 42, 34, 0.88);
}

.work-item h3 {
  margin: 1.8rem 0 1rem;
}

.work-item strong {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 0.82rem;
  gap: 0.45rem;
  margin-top: auto;
}

.work-item strong::after {
  content: "->";
  transition: transform 180ms ease;
}

.work-item:hover strong::after {
  transform: translateX(4px);
}

.work-links {
  display: flex;
  gap: 1.25rem;
  margin-top: auto;
  padding-top: 1.2rem;
}

.work-link {
  align-items: center;
  background: var(--paper-card);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(78, 59, 38, 0.04);
  color: var(--ink);
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 500;
  justify-content: center;
  min-height: 2.3rem;
  padding: 0 1.25rem;
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.work-link:hover {
  border-color: var(--ink);
  box-shadow: 0 10px 24px rgba(78, 59, 38, 0.12);
  transform: translateY(-2.5px) scale(1.03);
}

.work-link.demo {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.work-link.demo:hover {
  background: var(--paper-card);
  color: var(--ink);
}

[data-theme="dark"] .work-link {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .work-link:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.stack-panel {
  align-items: start;
  grid-template-columns: minmax(10rem, 0.28fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
}

.stack-board {
  display: grid;
  gap: 1rem;
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(3, minmax(13rem, 1fr));
  max-height: none;
  overflow: visible;
  padding: 0;
}

.stack-card {
  align-items: flex-start;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.9rem 1rem;
  grid-template-columns: 2.4rem 1fr;
  min-height: 9rem;
  padding: 1.1rem;
}

.stack-card img {
  height: 2rem;
  margin-top: 0.2rem;
  max-width: 2rem;
}

.stack-card h3 {
  font-size: clamp(1.05rem, 1.25vw, 1.35rem);
  margin-bottom: 0.45rem;
}

.stack-card p {
  font-size: clamp(0.82rem, 0.92vw, 0.94rem);
  line-height: 1.55;
}

.stack-panel .wave-ascii {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  margin-top: clamp(1.5rem, 4vw, 3rem);
  max-width: min(100%, 70rem);
  min-height: min(34vh, 20rem);
  opacity: 0.82;
  text-align: center;
}

.contact-panel {
  grid-template-columns: minmax(12rem, 0.45fr) minmax(0, 0.9fr);
}

.contact-card {
  display: grid;
  gap: clamp(1rem, 3vw, 2rem);
  grid-template-columns: minmax(0, 1fr) auto;
  max-width: 64rem;
}

.message-form {
  display: grid;
  gap: 0.85rem;
}

.message-form label {
  display: grid;
  gap: 0.35rem;
}

.message-form label span,
.form-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.message-form input,
.message-form textarea {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  color: var(--ink);
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  width: 100%;
}

.message-form textarea {
  resize: vertical;
}

.form-note {
  margin: 0;
}

.contact-icons {
  align-content: start;
  justify-content: center;
  justify-self: center;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(5.2rem, 1fr));
  width: min(100%, 26rem);
}

.icon-link {
  aspect-ratio: 1;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem;
  position: relative;
}

.icon-link::before {
  border-radius: inherit;
  content: "";
  inset: 0.4rem;
  opacity: 0.08;
  position: absolute;
}

.icon-link > * {
  position: relative;
}

.icon-link svg {
  height: 2rem;
  width: 2rem;
}

.icon-link span {
  font-size: 0.72rem;
}

.icon-link.mail {
  color: #b34d45;
}

.icon-link.mail::before {
  background: #b34d45;
}

.icon-link.github {
  color: #24201c;
}

[data-theme="dark"] .icon-link.github {
  color: #f1ead7;
}

.icon-link.github::before {
  background: currentColor;
}

.icon-link.linkedin {
  color: #276f9f;
}

.icon-link.linkedin::before {
  background: #276f9f;
}

.icon-link.coffee {
  color: #b98233;
}

.icon-link.coffee::before {
  background: #b98233;
}

@media (max-width: 860px) {
  html {
    scroll-padding-top: 8.5rem;
  }

  .site-header {
    align-items: center;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    min-height: auto;
    padding: 0.62rem 0.9rem;
  }

  .identity {
    font-size: 1.05rem;
  }

  nav {
    gap: 0.35rem;
    grid-column: auto;
    justify-content: flex-start;
    overflow-x: auto;
    width: 100%;
  }

  nav a {
    font-size: 0.74rem;
    flex: 1 0 auto;
    padding: 0.42rem 0.62rem;
    text-align: center;
  }

  .header-actions {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .site-controls {
    flex: 0 0 auto;
  }

  .control-button {
    font-size: 0.68rem;
    min-height: 2rem;
    padding: 0 0.62rem;
  }

  .header-social {
    gap: 0.35rem;
  }

  .header-social a {
    height: 2rem;
    width: 2rem;
  }

  .hero {
    gap: 2rem;
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 10.8rem 1rem 3rem;
  }

  .hero-details,
  .quiet-scene {
    grid-column: auto;
    grid-row: auto;
  }

  .quiet-scene {
    align-items: center;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
  }

  #sakura-ascii {
    align-self: center;
    max-width: 100%;
    transform: translateX(0);
  }

  h1 {
    font-size: clamp(2.25rem, 10.5vw, 3.95rem);
    max-width: 100%;
  }

  h2 {
    font-size: clamp(2.6rem, 13vw, 4.6rem);
  }

  p {
    font-size: 0.98rem;
    line-height: 1.65;
  }

  pre {
    font-size: clamp(0.34rem, 1.55vw, 0.52rem);
  }

  .river {
    height: auto;
  }

  .river-sticky {
    height: auto;
    overflow: visible;
    position: static;
  }

  .river-track {
    display: block;
    transform: none !important;
  }

  .river-panel,
  .profile-panel,
  .stack-panel,
  .contact-panel {
    display: grid;
    gap: 1.75rem;
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 3.8rem max(1.15rem, env(safe-area-inset-left)) 3.8rem max(1.15rem, env(safe-area-inset-right));
    scroll-margin-top: 9rem;
  }

  .work-list,
  .stack-board {
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .stack-panel .wave-ascii {
    grid-column: auto;
    grid-row: auto;
    margin-top: 0.5rem;
  }

  .work-item.featured {
    grid-column: auto;
  }

  .contact-card {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
    padding: 1.25rem;
  }

  .work-item,
  .stack-card,
  .contact-card {
    border-radius: 16px;
  }

  .contact-icons {
    display: flex;
    gap: 0.75rem;
    grid-template-columns: none;
    justify-content: flex-start;
    justify-self: stretch;
    overflow-x: auto;
    padding: 0.1rem 0.1rem 0.45rem;
    scroll-snap-type: x proximity;
    width: 100%;
  }

  .icon-link {
    flex: 0 0 8rem;
    scroll-snap-align: start;
  }

  .icon-link span {
    display: none;
  }

  .work-item {
    min-height: auto;
  }

  .soft-ascii,
  .wave-ascii {
    justify-self: center;
    max-height: none;
    min-height: 19rem;
    overflow: hidden;
    text-align: center;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .hero {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .work-item,
  .stack-card,
  .contact-card {
    padding: 1.15rem;
  }

  .contact-panel {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .site-controls,
  .header-social {
    justify-content: space-between;
    width: 100%;
  }

  .control-button {
    flex: 1;
  }

}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Styles for Project Modal */
.project-modal {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
  z-index: 999;
}

.project-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  background: rgba(37, 33, 27, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: -1;
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(15, 21, 21, 0.65);
}

.modal-window {
  background: var(--paper-card);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  box-shadow: var(--shadow);
  max-height: 90vh;
  max-width: 46rem;
  overflow-y: auto;
  padding: clamp(1.2rem, 3vw, 2.5rem);
  position: relative;
  width: 90%;
  z-index: 1;
}

.modal-close {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.25rem;
  height: 2.25rem;
  line-height: 1;
  position: absolute;
  right: clamp(1rem, 2vw, 1.5rem);
  top: clamp(1rem, 2vw, 1.5rem);
  transition: border-color 180ms ease, transform 180ms ease;
  width: 2.25rem;
}

.modal-close:hover {
  border-color: var(--ink);
  transform: scale(1.08);
}

.modal-header {
  margin-bottom: 1.2rem;
  padding-right: 2.2rem;
}

.modal-header h3 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 650;
  margin: 0.25rem 0 0;
}

.modal-desc p {
  font-size: 0.98rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-visual {
  margin: 0 0 1.8rem;
  width: 100%;
}

.hermnet-ascii {
  background: rgba(37, 33, 27, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--moss);
  font-size: clamp(0.38rem, 1.05vw, 0.68rem);
  line-height: 1.2;
  overflow-x: auto;
  padding: 1rem;
  text-align: left;
}

[data-theme="dark"] .hermnet-ascii {
  background: rgba(241, 234, 215, 0.02);
}

.modal-visual figcaption {
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: 0.5rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: flex-start;
}

.modal-actions .button {
  white-space: nowrap;
}
