@font-face {
  font-family: 'Portfolio Dot';

  font-display: swap;
  src: url('./fonts/dotgothic16-display.woff2?v=world6');
}

:root {
  --paper: #07110b;
  --ink: #d2f3d9;
  --muted: #9ab8a5;
  --accent: #85efa4;
  --line: #345441;
  --amber: #eed197;
  --cyan: #9bdfd5;
  --page-bg: #030805;
  --surface-deep: #09180f;
  --surface-panel: #09170f;
  --surface-raised: #193222;
  --surface-overlay: #020705ed;
  --strong-line: #548d64;
  --text-low: #79a586;
  --accent-wash: #85efa40a;
  --accent-glow: #85efa426;
  --grid-wash: #92e9a602;
  --bridge-wash: #19492b36;
  --shadow-tint: #5fef8a0b;
  --shadow-deep: #03080555;
  --mono: 'SFMono-Regular', consolas, 'Liberation Mono',
    'Hiragino Kaku Gothic ProN', meiryo, monospace;
  --display: 'Portfolio Dot', var(--mono);

  color-scheme: dark;
}

html[lang='ja'] {
  --paper: #0a1422;
  --ink: #dceaff;
  --muted: #a3bad9;
  --accent: #8dbbff;
  --line: #405b80;
  --amber: #ffd593;
  --cyan: #9bdcf8;
  --page-bg: #050b15;
  --surface-deep: #0a1729;
  --surface-panel: #0a1a2e;
  --surface-raised: #193454;
  --surface-overlay: #050b15ed;
  --strong-line: #5779a7;
  --text-low: #7d9fc8;
  --accent-wash: #8dbbff0a;
  --accent-glow: #8dbbff26;
  --grid-wash: #9bc7ff04;
  --bridge-wash: #28588b36;
  --shadow-tint: #76adff12;
  --shadow-deep: #050b1555;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 112px;
  scroll-padding-bottom: 140px;
}

body {
  margin: 0;
  font: 14px/1.85 var(--mono);
  color: var(--ink);
  background: var(--page-bg);
}

a {
  color: var(--accent);
  text-underline-offset: 5px;
}

a:hover {
  color: var(--amber);
}

a,
button,
summary {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
}

button,
input {
  font: inherit;
}

button,
summary {
  cursor: pointer;
}

button {
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: -120px;
  left: 16px;

  padding: 12px;

  color: var(--paper);

  background: var(--accent);
}

.skip-link:focus {
  top: 8px;
}

.terminal-shell {
  max-width: 1480px;
  margin: 20px auto;
  border: 1px solid var(--strong-line);

  background: var(--paper);
  box-shadow: 0 0 50px var(--shadow-tint);
}

.terminal-top {
  position: sticky;
  z-index: 5;
  top: 0;

  display: flex;
  gap: 18px;
  align-items: center;

  min-height: 44px;
  padding: 6px 20px;
  border-bottom: 1px solid var(--line);

  font-family: var(--mono);
  font-size: 12px;

  background: var(--surface-raised);
}

.terminal-lights {
  display: flex;
  gap: 7px;
}

.terminal-lights i {
  width: 8px;
  height: 8px;
  border: 1px solid var(--strong-line);
}

.terminal-lights i:nth-child(2) {
  background: var(--text-low);
}

.terminal-lights i:nth-child(3) {
  background: var(--accent);
}

.session-title {
  color: var(--accent);
}

.session-kind {
  color: var(--muted);
}

.motion-toggle {
  flex-shrink: 0;

  min-height: 32px;
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--strong-line);

  font-size: 11px;

  background: transparent;
}

.site-header {
  position: sticky;
  z-index: 4;
  top: 44px;

  display: flex;
  gap: 24px;
  align-items: center;

  min-height: 48px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);

  background: var(--surface-deep);
}

.identity {
  display: flex;
  gap: 8px;
  align-items: center;

  font-size: 13px;
  text-decoration: none;
}

.identity-mark {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
}

.identity-name {
  font-weight: 700;
  letter-spacing: -0.035em;
}

.host {
  display: none;
}

.site-header nav {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 12px;
}

.site-header nav a {
  display: inline-block;
  padding: 12px 0;
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a[aria-current],
.site-header nav a:hover {
  color: var(--accent);
  box-shadow: inset 0 -2px var(--accent);
}

.site-header nav a span {
  display: none;
}

.site-header .languages {
  gap: 12px;
  margin-left: auto;
}

.terminal-workspace {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
}

.file-tree {
  position: sticky;
  top: 112px;

  align-self: start;

  padding: 25px 18px;

  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.tree-title {
  margin: 0 0 18px;
  color: var(--cyan);
}

.file-tree > a {
  display: block;

  padding: 7px 0;

  color: var(--muted);
  text-decoration: none;
  white-space: pre;
}

.file-tree > a:hover,
.file-tree > a[aria-current] {
  color: var(--accent);
  background: var(--accent-wash);
}

.file-tree a span {
  color: var(--text-low);
}

.file-tree a small {
  float: right;
  font-size: 10px;
  color: var(--amber);
}

.file-tree .tree-child {
  font-size: 11px;
}

.tree-note {
  margin-top: 38px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  font-size: 10px;
}

.tree-note > span {
  color: var(--amber);
  letter-spacing: 0.08em;
}

.tree-note p {
  margin-block: 12px 20px;
}

main {
  min-width: 0;
  border-left: 1px solid var(--line);
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    var(--grid-wash) 3px,
    var(--grid-wash) 4px
  );
}

.wrap {
  width: auto;
  margin: 0;
  padding: 32px 36px;
}

section {
  scroll-margin-top: 12px;
}

section + section {
  border-top: 1px dashed var(--line);
}

#content:focus {
  outline: none;
}

.hero {
  padding: 0;
}

.visually-hidden {
  position: absolute;

  overflow: hidden;

  width: 1px;
  height: 1px;

  white-space: nowrap;

  clip-path: inset(50%);
}

.hero-video {
  position: relative;

  display: grid;
  place-items: center;

  height: calc(100svh - 116px);
  min-height: 380px;

  background: var(--paper);
}

.hero-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.career-cue {
  position: absolute;
  right: 24px;
  bottom: 76px;

  padding: 8px 12px;
  border: 1px solid var(--line);

  font-size: 12px;
  text-decoration: none;

  background: var(--paper);
}

.video-error {
  position: absolute;
  inset: 24% 12%;

  padding: 24px;
  border: 1px solid var(--line);

  text-align: center;

  background: var(--paper);
}

.video-error button {
  min-height: 44px;
  margin: 12px;
  padding: 8px 12px;
}

.work-story {
  margin: 28px 0;
  border: 1px solid var(--line);
}

.work-story #work-story-heading {
  font-size: clamp(28px, 3vw, 44px);
}

@media (width <= 640px) {
  .hero-video {
    height: calc(100svh - 132px);
    min-height: 300px;
  }

  .career-cue {
    right: 16px;
    bottom: 12px;
  }

  .work-story #work-story-heading {
    font-size: clamp(28px, 9vw, 42px);
  }
}

.terminal-body {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.intro-pane {
  min-width: 0;
  padding: 32px 28px 32px 36px;
}

.command-label,
.eyebrow {
  margin: 0 0 22px;
  font: 13px/1.7 var(--mono);
  color: var(--accent);
}

.command-label span {
  color: var(--cyan);
}

.hero .eyebrow {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.09em;
}

h1,
h2,
h3 {
  font-weight: 400;
}

.hero h1,
.work-story #work-story-heading {
  margin: 20px 0;

  font: 46px/1.35 var(--display);
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow);
  letter-spacing: -0.04em;
}

html[lang='ja'] .hero h1,
html[lang='ja'] .work-story #work-story-heading {
  font-size: clamp(26px, 3vw, 43px);
  line-height: 1.5;
}

h1 span {
  display: block;
}

h1 .cursor {
  display: inline;
  animation: cursor-pulse 1s steps(2, end) 4;
}

.intro-copy {
  max-width: 46ch;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--ink);
}

.quick-commands {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.quick-commands a {
  display: flex;
  flex-direction: column;

  padding-block: 8px;

  font-size: 12px;
  color: var(--amber);
  text-decoration: none;
}

.quick-commands a:hover {
  text-decoration: underline;
}

.quick-commands a > span {
  display: none;
}

.quick-commands small {
  font-size: 10px;
  color: var(--muted);
}

.signal-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;

  min-width: 0;
  margin: 0;
  border-left: 1px dashed var(--line);

  background: radial-gradient(ellipse at center, var(--bridge-wash), transparent 72%);
}

.visual-top {
  display: flex;
  gap: 10px;
  justify-content: space-between;

  padding: 24px 20px 0;

  font-size: 9px;
  color: var(--cyan);
}

#signal-canvas {
  display: block;
  width: 100%;
  height: 265px;
}

#signal-canvas:not([data-ready]) {
  display: none;
}

#signal-canvas[data-ready] + .ascii-fallback {
  display: none;
}

.ascii-fallback {
  margin: auto;
  padding-block: 36px;
  font: 17px/1.8 var(--mono);
  color: var(--accent);
}

.signal-visual figcaption {
  padding: 8px 12px 20px;
  font-size: 11px;
  color: var(--accent);
  text-align: center;
}

.visual-legend {
  display: flex;
  gap: 6px;
  justify-content: space-between;

  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px dashed var(--line);

  font-size: 9px;
  color: var(--muted);
}

.section-title {
  margin-bottom: 24px;
}

.section-title .eyebrow,
.contact > .eyebrow {
  margin: 0 0 20px;
}

.command-comment {
  font-size: 11px;
  color: var(--muted);
}

.section-title h2,
.contact h2 {
  margin: 0 0 10px;
  font: 23px/1.6 var(--display);
  color: var(--ink);
}

.section-title h2 br {
  display: none;
}

.section-title h2 span,
.contact h2 span {
  display: inline;
}

.section-title p:not(.eyebrow),
.contact > p:not(.eyebrow) {
  max-width: 70ch;
  margin-block: 10px 0;
  font-size: 13px;
  color: var(--muted);
}

.projects {
  display: grid;
  gap: 24px;
}

.all-works {
  display: inline-flex;
  gap: 12px;
  align-items: center;

  margin-top: 28px;
  padding: 12px 16px;
  border: 1px solid var(--line);

  font-size: 13px;
  text-decoration: none;

  background: var(--paper);
}

.all-works:hover,
.all-works:focus-visible {
  border-color: var(--accent);
  text-decoration: underline;
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr auto;
  column-gap: 24px;

  min-width: 0;
  padding: 0 22px 20px;
  border: 1px solid var(--line);
}

.window-bar {
  display: flex;
  grid-column: 1/-1;
  gap: 10px;
  align-items: center;

  margin: 0 -22px 20px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);

  font-size: 12px;
  color: var(--cyan);

  background: var(--surface-raised);
}

.window-bar span:last-child {
  margin-left: auto;
}

.project-image {
  overflow: hidden;
  display: block;
  grid-column: 2;
  grid-row: 2/5;
  align-self: start;

  padding: 5px;
  border: 1px solid var(--line);

  background: var(--surface-deep);
}

.project-image img {
  display: block;

  aspect-ratio: 1.44;
  width: 100%;
  height: auto;

  object-fit: cover;
  object-position: top;
  filter: saturate(0.7);

  transition: filter 0.25s;
}

.project-image:hover img {
  filter: saturate(1);
}

.project .image-caption {
  grid-column: 2;
  grid-row: 5;

  margin: 7px 0 0;

  font-size: 9px;
  color: var(--muted);
}

.project-heading {
  display: flex;
  grid-column: 1;
  grid-row: 2;
  gap: 12px;
  align-items: center;

  margin-bottom: 12px;
}

.project-number {
  font-size: 11px;
  color: var(--amber);
}

.project-number::before {
  content: '[';
}

.project-number::after {
  content: ']';
}

.project-heading .eyebrow {
  margin: 0;
  font-size: 9px;
  color: var(--muted);
}

.project-heading h3 {
  margin: 4px 0 0;
  font: 25px/1.4 var(--display);
  color: var(--accent);
}

.project-arrow {
  margin-left: auto;
  padding: 6px 10px;
  font-size: 18px;
  text-decoration: none;
}

.project .project-tagline {
  grid-column: 1;
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--ink);
}

.project > p:not(.image-caption, .project-tagline) {
  grid-column: 1;
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--muted);
}

.project details {
  grid-column: 1/-1;

  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);

  font-size: 12px;
  color: var(--muted);
}

summary {
  padding-block: 8px;
  color: var(--accent);
}

.project details p {
  max-width: 76ch;
}

.case-notes {
  margin: 20px 0;
}

.case-notes > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;

  padding-block: 12px;
  border-top: 1px solid var(--line);
}

.case-notes dt {
  color: var(--amber);
}

.case-notes dd {
  margin: 0;
}

.expertise {
  margin: 26px 0;
  border-block: 1px solid var(--line);
}

.expertise article {
  display: grid;
  grid-template-columns: 42px 185px 1fr;
  gap: 16px;
  align-items: baseline;

  padding: 18px 0;
}

.expertise article + article {
  border-top: 1px dashed var(--line);
}

.expertise h3 {
  margin: 0;
  font-size: 14px;
  color: var(--accent);
}

.expertise p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.resume {
  padding: 0 20px;
  border: 1px solid var(--line);
}

.resume > summary {
  display: flex;
  gap: 16px;
  justify-content: space-between;

  padding: 16px 0;

  font-size: 12px;
  list-style: none;
}

.resume > summary::-webkit-details-marker {
  display: none;
}

.file-label {
  display: block;
  font-size: 11px;
  color: var(--cyan);
}

.resume-action {
  flex-shrink: 0;
  color: var(--amber);
}

.resume-action::before {
  content: '[+] ';
}

.resume[open] .resume-action::before {
  content: '[-] ';
}

.resume-intro {
  padding-block: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}

.reading-column {
  max-width: 85ch;
  padding-bottom: 24px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.reading-column h2 {
  margin: 32px 0 20px;
  padding-block: 12px;
  border-block: 1px dashed var(--line);

  font: 21px/1.5 var(--display);
  color: var(--accent);
}

.reading-column h2::before {
  content: '## ';
  color: var(--muted);
}

.reading-column h3 {
  margin-top: 28px;
  font-size: 16px;
  color: var(--cyan);
}

.reading-column h3::before {
  content: '### ';
  color: var(--muted);
}

.reading-column h4 {
  font-size: 13px;
  color: var(--amber);
}

.reading-column p,
.reading-column li {
  color: var(--muted);
}

.reading-column strong {
  color: var(--ink);
}

.reading-column img {
  max-width: 100%;
  height: auto;
}

.reading-column table {
  overflow: auto;
  display: block;
}

.reading-column hr {
  border: 0;
  border-top: 1px dashed var(--line);
}

.reading-column .link-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-links {
  display: grid;
  margin-top: 24px;
  border-block: 1px solid var(--line);
}

.contact-links a {
  display: flex;
  gap: 16px;

  padding: 14px 8px;

  font-size: 14px;
  text-decoration: none;
}

.contact-links a::before {
  content: 'open';
  margin-right: 20px;
  font-size: 12px;
  color: var(--muted);
}

.contact-links a + a {
  border-top: 1px dashed var(--line);
}

.contact-links a:hover {
  background: var(--accent-wash);
}

.command-dock {
  scroll-margin-top: 100px;

  position: sticky;
  z-index: 6;
  bottom: 0;

  padding: 12px 24px;
  border-top: 1px solid var(--strong-line);

  font-family: var(--mono);

  background: var(--surface-panel);
  box-shadow: 0 -8px 22px var(--shadow-deep);
}

.command-dock form {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 13px;
}

.command-dock label {
  color: var(--accent);
  white-space: nowrap;
}

.command-dock input {
  width: 100%;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--strong-line);
  border-radius: 0;

  color: var(--ink);

  background: transparent;
}

.command-dock input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.command-dock button {
  flex-shrink: 0;

  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid #8c805f;

  color: var(--amber);

  background: transparent;
}

.command-dock p {
  margin: 4px 0 0;
  font-size: 10px;
  color: var(--muted);
}

#command-result:not(:empty) {
  font-size: 12px;
  color: var(--amber);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;

  padding: 12px 24px;
  border-top: 1px solid var(--line);

  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.site-footer a {
  padding: 4px;
}

@keyframes cursor-pulse {
  50% {
    opacity: 0;
  }
}

@keyframes terminal-reveal {
  from {
    background-color: var(--accent-wash);
  }

  to {
    background-color: transparent;
  }
}

.reveal-ready {
  animation: terminal-reveal 0.35s ease-out both;
}

.motion-paused *,
.motion-paused *::before,
.motion-paused *::after {
  animation-play-state: paused !important;
}

@media (width <= 1100px) {
  .terminal-shell {
    margin: 10px;
  }

  .terminal-workspace {
    grid-template-columns: 155px minmax(0, 1fr);
  }

  .file-tree {
    padding-inline: 12px;
    font-size: 11px;
  }

  .wrap {
    padding: 28px 24px;
  }

  .hero {
    padding: 0;
  }

  .intro-pane {
    padding: 28px 24px;
  }

  .terminal-body {
    grid-template-columns: 1.1fr 1fr;
  }

  .hero h1 {
    font-size: 34px;
  }

  .expertise article {
    grid-template-columns: 35px 145px 1fr;
    gap: 12px;
  }

  .site-header nav {
    gap: 12px;
    font-size: 11px;
  }

  .project {
    column-gap: 18px;
  }
}

@media (width <= 800px) {
  html {
    scroll-padding-top: 105px;
  }

  .terminal-shell {
    margin: 0;
    border-inline: 0;
  }

  .terminal-top {
    gap: 12px;
    padding-inline: 14px;
  }

  .session-kind {
    display: none;
  }

  .terminal-lights {
    gap: 5px;
  }

  .terminal-lights i {
    width: 6px;
    height: 6px;
  }

  .session-title {
    font-size: 10px;
  }

  .motion-toggle {
    padding-inline: 8px;
    font-size: 10px;
  }

  .site-header {
    gap: 12px;
    min-height: 44px;
    padding-inline: 14px;
  }

  .identity {
    display: none;
  }

  .site-header nav {
    gap: 16px;
    font-size: 10px;
  }

  .site-header nav a {
    padding-block: 12px;
  }

  .site-header .languages {
    gap: 10px;
  }

  .terminal-workspace {
    display: block;
  }

  .file-tree {
    display: none;
  }

  main {
    border-left: 0;
  }

  .terminal-body {
    grid-template-columns: 1fr;
  }

  .intro-copy {
    font-size: 12px;
  }

  .visual-top {
    padding-inline: 14px;
    font-size: 8px;
  }

  .visual-legend {
    padding-inline: 14px;
    font-size: 8px;
  }

  .expertise article {
    grid-template-columns: 32px 145px 1fr;
  }

  .command-dock {
    padding: 10px 16px;
  }

  .command-dock form {
    gap: 10px;
    font-size: 11px;
  }

  .command-dock label {
    font-size: 10px;
  }

  .command-dock button {
    padding-inline: 10px;
  }

  .site-footer > span:last-child {
    display: none;
  }
}

@media (width <= 580px) {
  .terminal-body {
    display: block;
  }

  .intro-pane {
    padding: 24px 20px 18px;
  }

  .hero h1,
  html[lang='ja'] .hero h1 {
    margin-block: 18px;
    font-size: clamp(26px, 7.5vw, 38px);
  }

  .command-label {
    margin-bottom: 16px;
  }

  .intro-copy {
    margin-bottom: 16px;
  }

  .signal-visual {
    border-top: 1px dashed var(--line);
    border-left: 0;
  }

  .visual-top {
    padding: 12px 20px 0;
    font-size: 9px;
  }

  #signal-canvas {
    height: 180px;
  }

  .ascii-fallback {
    padding-block: 24px;
    font-size: 15px;
  }

  .signal-visual figcaption {
    padding-bottom: 12px;
  }

  .visual-legend {
    padding: 10px 20px;
    font-size: 9px;
  }

  .wrap {
    padding: 26px 20px;
  }

  .hero {
    padding: 0;
  }

  .section-title h2,
  .contact h2 {
    font-size: 20px;
  }

  .section-title p:not(.eyebrow),
  .contact > p:not(.eyebrow) {
    font-size: 12px;
  }

  .eyebrow,
  .command-label {
    font-size: 12px;
  }

  .command-comment {
    font-size: 10px;
  }

  .project {
    display: flex;
    flex-direction: column;
    padding: 0 16px 12px;
  }

  .window-bar {
    order: 0;
    margin-bottom: 16px;
    margin-inline: -16px;
    font-size: 11px;
  }

  .project-heading {
    order: 1;
  }

  .project .project-tagline {
    order: 2;
    font-size: 14px;
  }

  .project > p:not(.image-caption, .project-tagline) {
    order: 3;
  }

  .project-image {
    align-self: stretch;
    order: 4;
  }

  .project .image-caption {
    order: 5;
  }

  .project details {
    order: 6;
    margin-top: 12px;
  }

  .case-notes > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .expertise article {
    grid-template-columns: 32px 1fr;
    gap: 8px 12px;
    padding-block: 16px;
  }

  .expertise p {
    grid-column: 2;
  }

  .resume {
    padding-inline: 14px;
  }

  .resume > summary {
    display: block;
  }

  .resume-action {
    display: block;
    margin-top: 10px;
  }

  .reading-column {
    font-size: 12px;
  }

  .reading-column h2 {
    font-size: 19px;
  }

  .reading-column h3 {
    font-size: 15px;
  }

  .contact-links a {
    font-size: 13px;
  }

  .command-dock {
    position: relative;
  }

  .command-dock form {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .command-dock label {
    width: 100%;
  }

  .command-dock input {
    flex: 1;
  }

  .command-dock p {
    font-size: 9px;
  }

  .site-footer {
    padding-inline: 16px;
  }
}

@media (width <= 360px) {
  .terminal-lights {
    display: none;
  }

  .site-header {
    gap: 8px;
    padding-inline: 10px;
  }

  .site-header nav {
    gap: 10px;
    font-size: 9px;
  }

  .site-header .languages {
    gap: 8px;
  }

  .wrap {
    padding-inline: 16px;
  }

  .hero {
    padding: 0;
  }
}

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

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

@media print {
  :root {
    --paper: white;
    --ink: #16251a;
    --muted: #324939;
    --accent: #214d2e;
    --line: #777;

    color-scheme: light;
  }

  body {
    background: white;
  }

  .terminal-shell {
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  .terminal-top,
  .site-header,
  .file-tree,
  .command-dock,
  .site-footer,
  .signal-visual,
  .hero-video,
  .skip-link {
    display: none;
  }

  .terminal-workspace,
  .terminal-body {
    display: block;
  }

  main {
    border: 0;
  }

  .wrap {
    padding: 20px 0;
  }

  .resume > summary {
    display: none;
  }

  .resume::details-content {
    content-visibility: visible;
  }

  .project {
    break-inside: avoid;
  }
}

.path-error {
  padding: 24px 36px;
  border-bottom: 1px dashed var(--amber);
  color: var(--amber);
  background: #eed19708;
}

.path-error h1 {
  font: 23px var(--display);
}

.path-error p {
  max-width: 70ch;
  font-size: 12px;
}

/* Decision trace: a two-pane terminal debugger for product reasoning. */
.decision-trace {
  margin: 42px 0 64px;
  border: 1px solid var(--line);
  background: var(--surface-panel);
}

.trace-heading {
  display: flex;
  gap: 28px;
  align-items: end;
  justify-content: space-between;

  padding: 28px;
  border-bottom: 1px solid var(--line);
}

.trace-heading h3 {
  margin: 8px 0 0;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 400;
}

.trace-heading > p {
  max-width: 300px;
  font-size: 13px;
  color: var(--muted);
}

.trace-projects {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.trace-projects button {
  flex: 1;

  padding: 18px 24px;
  border: 0;
  border-right: 1px solid var(--line);

  font-family: var(--mono);
  font-size: 19px;
  text-align: left;

  background: transparent;
}

.trace-projects button[aria-pressed='true'] {
  color: var(--paper);
  background: var(--accent);
}

.trace-projects button span {
  margin-right: 12px;
  font-size: 11px;
}

.trace-projects small {
  display: block;
  margin-top: 6px;
  font-family: var(--display);
  font-size: 12px;
}

.trace-case {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
}

.trace-route {
  padding: 28px 24px;
  border-right: 1px solid var(--line);
}

.trace-step {
  position: relative;
  padding: 0 0 30px 18px;
  border-left: 1px dashed var(--line);
}

.trace-step:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.trace-step h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
}

.trace-step button {
  width: 100%;
  padding: 10px 0;
  border: 0;

  color: var(--muted);
  text-align: left;

  background: transparent;
}

.trace-step button:hover,
.trace-step.is-selected button {
  color: var(--accent);
}

.trace-node {
  display: inline-block;
  margin-right: 12px;
  font: 12px var(--mono);
  color: var(--amber);
}

.trace-step.is-selected::before {
  content: '>';

  position: absolute;
  top: 14px;
  left: -6px;

  color: var(--accent);

  background: var(--surface-panel);
}

.trace-step p {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.trace-ready .trace-step:not(.is-selected) p {
  display: none;
}

.trace-inspect {
  min-width: 0;
  padding: 22px;
}

.trace-status {
  display: flex;
  gap: 12px;
  justify-content: space-between;

  font: 11px var(--mono);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.trace-stage {
  margin: 24px 0 10px;
  font-size: 13px;
  color: var(--amber);
}

.trace-copy {
  min-height: 132px;
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.8;
}

.trace-inspect figure {
  margin: 0 0 18px;
}

.trace-inspect img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.trace-inspect figcaption {
  margin-top: 8px;
  font-size: 10px;
  color: var(--muted);
}

.trace-inspect > a {
  font-size: 12px;
}

@media (width <= 700px) {
  .trace-heading {
    display: block;
    padding: 20px;
  }

  .trace-heading > p {
    max-width: none;
  }

  .trace-projects button {
    padding: 14px;
    font-size: 17px;
  }

  .trace-case {
    grid-template-columns: 1fr;
  }

  .trace-route {
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .trace-ready .trace-route {
    display: flex;
    gap: 8px;
  }

  .trace-ready .trace-step {
    flex: 1;
    padding: 0;
    border: 0;
  }

  .trace-ready .trace-step h4 {
    font-size: 13px;
  }

  .trace-ready .trace-step p {
    display: none;
  }

  .trace-ready .trace-node {
    display: block;
    margin: 0 0 6px;
  }

  .trace-ready .trace-step button {
    padding: 8px;
    border-bottom: 2px solid transparent;
  }

  .trace-ready .trace-step.is-selected button {
    border-color: var(--accent);
  }

  .trace-step.is-selected::before {
    display: none;
  }

  .trace-inspect {
    padding: 18px;
  }

  .trace-copy {
    min-height: 140px;
    font-size: 17px;
  }
}

.bridge-controls {
  gap: 0;
  padding: 0;
}

.bridge-controls button {
  flex: 1;

  padding: 14px 6px;
  border: 0;
  border-top: 1px solid var(--line);

  font: 11px var(--mono);
  color: var(--muted);

  background: transparent;
}

.bridge-controls button[aria-pressed='true'] {
  color: var(--paper);
  background: var(--accent);
}

.bridge-controls button:hover {
  color: var(--amber);
  background: var(--surface-raised);
}

.signal-visual figcaption {
  min-height: 78px;
}

.trace-ready .trace-step p {
  display: none;
}

.trace-ready .trace-route {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.trace-ready .trace-step {
  flex: 1;
}

.trace-ready .trace-step button {
  padding-block: 20px;
}

.trace-step.is-selected::before {
  top: 24px;
}

@media (width <= 700px) {
  .trace-ready .trace-route {
    flex-direction: row;
  }

  .trace-ready .trace-step button {
    padding-block: 8px;
  }

  .bridge-controls button {
    font-size: 10px;
  }
}

.trace-hint {
  display: block;

  margin: 4px 0 0 30px;

  font: 10px var(--mono);
  color: var(--muted);
  letter-spacing: 0.14em;
}

@media (width <= 700px) {
  .trace-hint {
    display: none;
  }
}

.trace-zoom {
  cursor: zoom-in;

  display: block;

  width: 100%;
  padding: 0;
  border: 0;

  background: transparent;
}

.trace-image-dialog {
  width: min(1280px, 94vw);
  max-width: 94vw;
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--accent);

  color: var(--ink);

  background: var(--paper);
}

.trace-image-dialog::backdrop {
  background: var(--surface-overlay);
}

.trace-image-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;

  padding: 12px 18px;
  border-bottom: 1px solid var(--line);

  font: 12px/1.6 var(--mono);
}

.trace-image-bar button {
  flex-shrink: 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
}

.trace-image-viewport {
  overflow: auto;
  max-height: 78vh;
}

.trace-image-viewport img {
  display: block;
  width: 100%;
  min-width: 900px;
  height: auto;
}

.trace-image-viewport:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: -3px;
}

/* Keep every decision reachable while the captured interface is being inspected. */
.trace-ready .trace-route {
  position: sticky;
  top: 112px;
  align-self: start;
  justify-content: flex-start;
}

.trace-ready .trace-step {
  flex: none;
  padding-bottom: 18px;
}

.trace-ready .trace-step:last-child {
  padding-bottom: 0;
}

@media (width <= 700px) {
  .trace-ready .trace-route {
    position: static;
  }

  .trace-ready .trace-step {
    flex: 1;
    padding: 0;
  }
}

main [tabindex='-1']:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 4px;
}

/* Iteration 6: crisp terminal prose; phosphor display type marks hierarchy. */
.section-title h2,
.contact h2,
.trace-heading h3 {
  font-family: var(--display);
}

.intro-copy {
  max-width: 39ch;
  font-size: 14px;
  line-height: 1.95;
}

.hero h1 {
  font-size: clamp(38px, 4.2vw, 62px);
}

html[lang='ja'] .hero h1 {
  font-size: clamp(30px, 3.5vw, 50px);
  line-height: 1.45;
}

.signal-visual {
  background: radial-gradient(ellipse at 48% 54%, var(--bridge-wash), transparent 70%);
}

#signal-canvas {
  height: 300px;
}

.bridge-views {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;

  padding: 0 16px 16px;

  font: 10px var(--mono);
}

.bridge-views > span {
  margin-right: 8px;
  color: var(--muted);
}

.bridge-views button {
  padding: 8px 12px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
}

.bridge-views button[aria-pressed='true'] {
  border-color: #806d49;
  color: var(--amber);
  background: #eed1970a;
}

.bridge-views button:hover {
  border-color: var(--line);
  color: var(--ink);
}

.bridge-controls button {
  transition: background-color 180ms, color 180ms;
}

.trace-projects small {
  font-family: var(--mono);
}

.trace-output p {
  line-height: 1.9;
}

@media (width <= 800px) {
  .hero h1,
  html[lang='ja'] .hero h1 {
    font-size: clamp(28px, 4vw, 42px);
  }

  .intro-copy {
    font-size: 13px;
  }
}

@media (width <= 580px) {
  .hero h1,
  html[lang='ja'] .hero h1 {
    font-size: clamp(29px, 8.4vw, 40px);
  }

  #signal-canvas {
    height: 224px;
  }

  .bridge-views {
    padding-bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bridge-controls button {
    transition: none;
  }
}

.motion-paused .bridge-controls button {
  transition: none;
}

/* Keep the command prompt present without covering the work being read. */
@media (width >= 581px) {
  .command-dock {
    padding-block: 6px;
  }

  #command-help {
    display: none;
  }

  .command-dock:focus-within #command-help {
    display: block;
  }

  #command-result:empty {
    display: none;
  }
}

.intro-pane {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.bridge-example {
  display: flex;
  flex-direction: column;
  gap: 5px;

  margin-top: auto;
  padding-top: 30px;

  font-size: 11px;
  text-decoration: none;
}

.bridge-example > span {
  color: var(--muted);
}

.bridge-example code {
  font: 11px var(--mono);
  color: var(--amber);
}

.bridge-example:hover code {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (width <= 580px) {
  .bridge-example {
    padding-top: 16px;
  }
}

.contact-links a > span:first-child {
  flex: 1;
}

.resume-directory {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;

  margin: 28px 0 18px;

  font-size: 13px;
}

.resume-directory a {
  padding: 10px 0;
  text-underline-offset: 5px;
}

.session-brand {
  display: none;
}

@media (width <= 900px) {
  .session-brand {
    display: flex;
    flex: 0 0 28px;
  }

  .terminal-lights {
    display: none;
  }
}

/* A real design decision anchors the bridge metaphor from the first screen. */
.hero-proof {
  margin: 20px 0;
  border: 1px solid var(--line);
  background: var(--surface-panel);
}

.proof-heading {
  display: flex;
  gap: 8px;
  justify-content: space-between;

  padding: 10px 12px;

  font: 10px/1.5 var(--mono);
  color: var(--cyan);
}

.hero-proof .bridge-controls {
  margin: 0;
  border-block: 1px solid var(--line);
}

.hero-proof .bridge-controls button {
  min-height: 40px;
  font-size: 10px;
}

.proof-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 152px;
}

.proof-words {
  padding: 12px;
}

.proof-label {
  margin: 0 0 8px;
  font: 11px/1.5 var(--mono);
  color: var(--amber);
}

.proof-copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}

.proof-image-link {
  position: relative;
  overflow: hidden;
  display: block;
  border-left: 1px solid var(--line);
}

.proof-image {
  display: block;

  width: 100%;
  height: 100%;
  min-height: 152px;
  max-height: 260px;

  object-fit: contain;
  background: #fffdf5;
}

.proof-image-link span {
  position: absolute;
  right: 0;
  bottom: 0;

  padding: 4px 8px;

  font: 10px/1.5 var(--mono);
  color: var(--accent);

  background: var(--surface-panel);
}

.proof-choice {
  margin: 0;
  padding: 8px 12px;
  border-top: 1px dashed var(--line);

  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}

.hero h1,
html[lang='ja'] .hero h1 {
  margin: 14px 0;
  font-size: clamp(28px, 3vw, 44px);
}

.intro-pane .intro-copy {
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.8;
}

.intro-pane .quick-commands {
  flex-direction: row;
  gap: 8px 22px;
}

.intro-pane .bridge-example {
  padding-top: 14px;
}

@media (width <= 580px) {
  .intro-pane {
    padding-top: 18px;
    padding-bottom: 20px;
  }

  .hero .command-label {
    margin-bottom: 12px;
  }

  .hero-proof {
    margin: 14px 0;
  }

  .proof-heading {
    flex-wrap: wrap;
    padding: 8px;
  }

  .proof-pair {
    grid-template-columns: 1fr;
    min-height: 164px;
  }

  .proof-words {
    padding: 9px;
  }

  .proof-copy {
    font-size: 11px;
    line-height: 1.65;
  }

  .proof-image-link {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .proof-image {
    height: 190px;
    min-height: 0;
  }
}
