:root {
  color-scheme: light;
  --ink: #0d1628;
  --muted: #647086;
  --cream: #fff8e8;
  --line: #0d1628;
  --pink: #ffe3ea;
  --blue: #ddf1ff;
  --green: #d9f8e8;
  --purple: #8d92ff;
  --lavender: #eee9ff;
  --yellow: #ffd91f;
  --orange: #ff6f3c;
  --shadow: 10px 12px 0 #0d1628;
  --soft-shadow: 5px 7px 0 rgba(13, 22, 40, 0.18);
  --page-pad: clamp(18px, 4vw, 56px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 98px;
  background: var(--cream);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18px 18px, rgba(13, 22, 40, 0.045) 2px, transparent 2.6px) 0 0 / 34px 34px,
    linear-gradient(180deg, #fff9eb 0%, #fff6dd 58%, #f5fff9 100%);
  font-family: Inter, "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.55;
  letter-spacing: 0;
  overflow-x: hidden;
  overflow-x: clip;
  word-break: keep-all;
  overflow-wrap: break-word;
}

body.modal-open {
  position: fixed;
  right: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(141, 146, 255, 0.18) 48% 52%, transparent 52%),
    linear-gradient(45deg, transparent 0 67%, rgba(255, 217, 31, 0.2) 67% 70%, transparent 70%);
  opacity: 0.45;
}

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

a {
  text-decoration: none;
}

button {
  appearance: none;
  border-radius: inherit;
  -webkit-touch-callout: none;
  user-select: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px var(--page-pad) 12px;
  background: linear-gradient(180deg, rgba(255, 248, 232, 0.94), rgba(255, 248, 232, 0.7));
  backdrop-filter: blur(12px);
}

.logo-pill,
.sticker,
.section-label,
.label-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 4px solid var(--line);
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 4px 5px 0 var(--line);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.logo-pill,
.sticker {
  min-height: 38px;
  padding: 8px 18px;
  border-radius: 999px;
  transform: rotate(-8deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a,
.socials a,
.button,
.mini-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--line);
  background: #fff;
  box-shadow: 4px 5px 0 var(--line);
  color: var(--ink);
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.nav-links a {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.86rem;
}

.nav-links a:hover,
.socials a:hover,
.button:hover,
.mini-actions button:hover,
.project-photo:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 8px 0 var(--line);
}

.nav-links a:active,
.socials a:active,
.button:active,
.mini-actions button:active,
.project-photo:active,
.work-highlight:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 3px 0 var(--line);
}

@media (hover: none) and (pointer: coarse) {
  a,
  button {
    -webkit-tap-highlight-color: transparent;
  }

  a:focus,
  button:focus {
    outline: none;
  }

  .nav-links a:hover,
  .socials a:hover,
  .button:hover,
  .mini-actions button:hover,
  .project-photo:hover,
  .work-highlight:hover {
    transform: none;
  }

  .nav-links a:active,
  .socials a:active,
  .button:active,
  .mini-actions button:active,
  .project-photo:active,
  .work-highlight:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 3px 0 var(--line);
  }
}

main {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 0 var(--page-pad) 70px;
  overflow-x: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: clamp(50px, 5.2vw, 76px) 0 clamp(40px, 4.8vw, 68px);
}

.hero h1 {
  margin: clamp(28px, 3vw, 44px) 0 10px;
  font-size: clamp(3.4rem, 10vw, 10rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.86;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.hero h1 span {
  color: #7777ff;
  text-shadow: 6px 7px 0 rgba(13, 22, 40, 0.12);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.15rem, 2vw, 1.65rem);
  font-weight: 900;
}

.subtitle::before {
  content: "✦";
  margin-right: 10px;
  color: var(--orange);
}

.hero-note {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--ink);
  font-size: clamp(0.98rem, 1.4vw, 1.14rem);
  font-weight: 800;
  line-height: 1.7;
}

.socials {
  display: flex;
  gap: 18px;
  padding-top: 18px;
}

.socials a {
  width: 92px;
  aspect-ratio: 1;
  border-radius: 22px;
  font-size: 1.35rem;
}

.socials svg {
  width: 44px;
  height: 44px;
}

.socials .gmail-mark {
  width: 52px;
  height: auto;
}

.bento-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(0, 2.05fr);
  gap: 30px;
  align-items: stretch;
  margin-top: 34px;
}

.card {
  position: relative;
  border: 5px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pastel-pink {
  background: var(--pink);
}

.pastel-blue {
  background: var(--blue);
}

.pastel-green {
  background: var(--green);
}

.pastel-purple {
  background: var(--purple);
}

.pastel-lavender {
  background: var(--lavender);
}

.intro-card,
.profile-card,
.adventure-card,
.talks-card,
.plate-card,
.projects-section,
.skill-card,
.contact-card {
  padding: clamp(20px, 3vw, 34px);
}

.intro-card {
  min-height: clamp(520px, 43vw, 680px);
  padding: clamp(24px, 3vw, 40px);
  transform: rotate(-1.2deg);
}

.profile-card {
  display: flex;
  align-self: start;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: clamp(430px, 36vw, 560px);
  padding: clamp(22px, 2.6vw, 38px) clamp(22px, 3vw, 36px);
  background: linear-gradient(145deg, #e7e3ff 0%, #f4ecff 100%);
  transform: rotate(-1.4deg);
}

.adventure-card {
  grid-column: 1 / -1;
  min-height: 600px;
}

.section-label {
  min-height: 34px;
  padding: 7px 14px;
  border-width: 0;
  background: transparent;
  box-shadow: none;
  font-size: clamp(0.92rem, 1.2vw, 1.2rem);
}

.label-pill {
  margin-bottom: 26px;
  padding: 8px 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 4px 5px 0 var(--line);
}

.photo-frame,
.wide-frame {
  position: relative;
  margin: 0;
  border: 5px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
}

.photo-frame {
  aspect-ratio: 1 / 0.88;
  transform: rotate(-1.6deg);
}

.intro-card .photo-frame {
  aspect-ratio: 16 / 9.5;
  border-radius: 24px;
  transform: rotate(-1.1deg);
}

.profile-frame {
  position: relative;
  width: min(340px, 92%);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 5px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #dff4ff;
}

.profile-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15);
}

.profile-sticker {
  position: absolute;
  left: 50%;
  bottom: clamp(54px, 6.6vw, 88px);
  margin: 0;
  padding: 11px 28px 12px 30px;
  border: 5px solid var(--line);
  border-radius: 15px;
  background: var(--yellow);
  box-shadow: 7px 8px 0 var(--line);
  font-size: clamp(0.95rem, 1.4vw, 1.25rem);
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
  transform: translateX(-50%) rotate(-2deg);
  z-index: 2;
}

.profile-sticker::before {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -24px;
  width: 0;
  height: 0;
  border-top: 24px solid var(--line);
  border-right: 24px solid transparent;
}

.profile-sticker::after {
  content: "";
  position: absolute;
  left: 29px;
  bottom: -12px;
  width: 0;
  height: 0;
  border-top: 14px solid var(--yellow);
  border-right: 14px solid transparent;
}

.burst {
  position: absolute;
  top: 50%;
  right: 0;
  width: 0;
  height: 0;
}

.burst span {
  position: absolute;
  left: 20px;
  top: -3px;
  width: 12px;
  height: 6px;
  background: var(--orange);
  border-radius: 999px;
  transform-origin: -20px 50%;
}

.burst span:nth-child(1) {
  transform: rotate(-45deg);
}

.burst span:nth-child(2) {
  transform: rotate(-10deg);
}

.burst span:nth-child(3) {
  transform: rotate(30deg);
}



.wide-frame {
  margin-top: 28px;
  aspect-ratio: 16 / 6.1;
}

.photo-frame img,
.wide-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wide-frame img {
  object-position: left center;
}

figcaption {
  position: absolute;
  right: 16px;
  bottom: 14px;
  padding: 7px 12px;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 0.86rem;
  font-weight: 900;
}

.intro-card h2,
.adventure-card h2,
.plate-card h2,
.contact-card h2 {
  margin: 26px 0 10px;
  font-size: clamp(1.8rem, 3vw, 3.2rem);
  line-height: 1.05;
  font-weight: 900;
}

.intro-card h2 {
  text-align: center;
  font-style: italic;
}

.intro-card h2 {
  margin-top: clamp(18px, 2.1vw, 28px);
}

.intro-card p {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
  line-height: 1.48;
}

.intro-card p,
.adventure-card p,
.plate-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
  font-weight: 800;
}

.talks-card {
  min-height: 470px;
}

.scribble {
  margin: 28px 0 22px;
  color: rgba(13, 22, 40, 0.38);
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.talk-list {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.talk-list li {
  padding: 18px;
  border: 4px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.talk-list strong,
.talk-list span {
  display: block;
}

.talk-list strong {
  margin-bottom: 4px;
  font-size: 1.15rem;
}

.talk-list span {
  color: var(--muted);
  font-weight: 800;
}

.ai-section {
  grid-column: 1 / -1;
  padding: clamp(22px, 3vw, 34px);
  background: #0a0a0a;
  color: #fff;
  box-shadow: var(--shadow);
}

.ai-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

.ai-pill {
  transform: rotate(-3deg);
  white-space: nowrap;
}

.ai-lead {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1rem, 1.55vw, 1.26rem);
  font-weight: 900;
  line-height: 1.7;
}

.ai-phase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ai-phase-card {
  position: relative;
  min-height: 230px;
  padding: 26px 24px 22px;
  border: 4px solid rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  background: #101010;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.ai-phase-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 7px 0 rgba(255, 217, 31, 0.9);
}

.ai-phase-number {
  position: absolute;
  right: 18px;
  top: 10px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.28);
  font-size: clamp(4rem, 8vw, 7.5rem);
  font-weight: 900;
  line-height: 0.8;
  pointer-events: none;
}

.ai-phase-card h3,
.ai-phase-card strong,
.ai-phase-card p,
.ai-phase-card code {
  position: relative;
  z-index: 1;
}

.ai-phase-card h3 {
  margin: 0 0 4px;
  color: var(--yellow);
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 900;
  letter-spacing: 0;
}

.ai-phase-card strong {
  display: block;
  margin-bottom: 18px;
  color: #fff;
  font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  line-height: 1.18;
}

.ai-phase-card strong::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.ai-phase-card p {
  max-width: 36rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.65;
}

.ai-phase-card code {
  display: block;
  margin-top: 14px;
  color: #777;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
}

.ai-footer {
  margin-top: 26px;
  text-align: center;
}

.ai-footer p {
  margin: 0;
  color: #fff;
  font-size: clamp(1.02rem, 1.6vw, 1.28rem);
  font-weight: 900;
  line-height: 1.6;
}

.ai-footer span {
  display: block;
  margin-top: 6px;
  color: #888;
  font-size: 0.9rem;
  font-weight: 800;
}

.plate-card {
  display: flex;
  min-height: 470px;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  text-align: center;
}

.paper-stack {
  position: relative;
  width: min(260px, 70%);
  aspect-ratio: 1;
  margin-top: 10px;
  padding: 22px;
  border: 4px solid var(--line);
  background: #fff;
  box-shadow: 12px 12px 0 rgba(13, 22, 40, 0.7);
  transform: rotate(7deg);
}

.paper-stack::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  width: 88px;
  height: 34px;
  background: rgba(255, 255, 255, 0.7);
  transform: translateX(-50%);
}

.paper-stack img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 3px solid var(--line);
}

.plate-card h2 {
  margin-bottom: 4px;
  color: #fff;
  text-shadow: 4px 5px 0 rgba(13, 22, 40, 0.65);
}

.plate-card p {
  display: inline-flex;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(13, 22, 40, 0.32);
  color: var(--yellow);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.projects-section {
  margin-top: 42px;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.6fr);
  gap: 36px;
  align-items: stretch;
}

.project-stack {
  display: grid;
  gap: 18px;
}

.project-photo {
  position: relative;
  min-height: 360px;
  padding: 0;
  border: 5px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: #000;
  box-shadow: 6px 7px 0 var(--line);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.project-photo img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  opacity: 0.78;
}

.project-photo span {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  color: #fff;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-style: italic;
  font-weight: 800;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.48);
}

.project-photo strong {
  display: block;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-style: normal;
  line-height: 1.05;
}

.terminal-card {
  position: relative;
  min-height: 310px;
  padding: 70px 38px 32px;
  border: 5px solid var(--line);
  border-radius: 22px;
  background: #0c172b;
  color: #d9dfef;
  box-shadow: inset 0 34px 0 #1a273a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 800;
}

.terminal-card p {
  margin: 0 0 16px;
}

.terminal-green {
  color: #50f58d;
}

.terminal-dots {
  position: absolute;
  top: 10px;
  left: 18px;
  display: flex;
  gap: 10px;
}

.terminal-dots span {
  width: 13px;
  aspect-ratio: 1;
  border-radius: 999px;
}

.terminal-dots span:nth-child(1) {
  background: #ff5656;
}

.terminal-dots span:nth-child(2) {
  background: #ffc22e;
}

.terminal-dots span:nth-child(3) {
  background: #32d576;
}

.cursor {
  display: inline-block;
  width: 10px;
  height: 1.2em;
  margin-left: 5px;
  background: #d9dfef;
  vertical-align: -0.22em;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.mini-actions button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
}

.work-highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.work-highlight {
  min-height: 210px;
  padding: 20px;
  border: 4px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 5px 6px 0 var(--line);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.work-highlight:hover,
.work-highlight:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 8px 9px 0 var(--line);
  outline: none;
}

.work-highlight span {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.work-highlight strong {
  display: block;
  margin-bottom: 10px;
  font-size: clamp(1rem, 1.7vw, 1.28rem);
  line-height: 1.18;
}

.work-highlight p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.58;
}

.skills-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 42px;
}

.skill-card {
  min-height: 190px;
  padding: 24px;
  background: #fff;
}

.skill-card span {
  display: block;
  margin-bottom: 38px;
  color: var(--orange);
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

.skill-card strong {
  display: block;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.22;
}

.contact-card {
  margin-top: 42px;
  background: #fff;
  text-align: center;
}

.contact-card .sticker {
  margin: 0 auto 18px;
}

.contact-card h2 {
  max-width: 1020px;
  margin-right: auto;
  margin-left: auto;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.button {
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  cursor: pointer;
}

.button.dark {
  background: var(--ink);
  color: #fff;
}

.button.light {
  background: var(--yellow);
}

.case-dialog {
  width: min(1040px, calc(100% - 28px));
  max-height: min(830px, calc(100vh - 28px));
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: clamp(24px, 4vw, 48px);
  border: 5px solid var(--line);
  border-radius: 26px;
  background: #fffdf6;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.case-dialog::-webkit-scrollbar {
  display: none;
}

.case-dialog::backdrop {
  background: rgba(13, 22, 40, 0.46);
  backdrop-filter: blur(7px);
}

.dialog-close {
  position: sticky;
  top: -8px;
  z-index: 10;
  float: right;
  margin-top: -8px;
  margin-right: -12px;
  margin-bottom: 20px;
  width: 46px;
  aspect-ratio: 1;
  border: 4px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 4px 5px 0 var(--line);
  cursor: pointer;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.dialog-banner {
  clear: right;
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(230px, 34vw, 420px);
  margin: 0 0 30px;
  border: 5px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: var(--blue);
}

.dialog-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-banner[data-fit="contain"] img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.dialog-banner[data-tone="dark"] {
  background: #0c172b;
}

.kicker {
  margin: 0 0 8px;
  color: var(--orange);
  font-weight: 900;
  text-transform: uppercase;
}

.dialog-title-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.case-dialog h2 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.02;
}

.dialog-action-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 18px;
  font-size: 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
}

.dialog-action-button img,
.dialog-action-button svg {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.dialog-summary {
  max-width: 820px;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 800;
}

.dialog-meta-grid,
.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dialog-meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.dialog-meta-grid section,
.dialog-grid section,
.dialog-tools {
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  border: 4px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.dialog-meta-grid h3,
.dialog-grid h3,
.dialog-tools h3 {
  margin: 0 0 10px;
  color: var(--orange);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.dialog-meta-grid p,
.dialog-grid p,
.dialog-grid li {
  max-width: 100%;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-break: strict;
  overflow-wrap: break-word;
  word-break: normal;
}

.dialog-tools {
  margin: 16px 0 28px;
}

.dialog-tools div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dialog-tools span {
  padding: 6px 12px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--yellow);
  font-size: 0.82rem;
  font-weight: 900;
}

.dialog-grid ul {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding-left: 1.15em;
}

.dialog-grid li {
  min-width: 0;
  padding-left: 0.1em;
}

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

  .socials {
    padding-top: 0;
  }

  .bento-grid,
  .skills-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .adventure-card,
  .projects-section {
    grid-column: 1 / -1;
  }

  .project-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --page-pad: 16px;
    --shadow: 5px 6px 0 #0d1628;
  }

  body {
    word-break: normal;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px var(--page-pad) 10px;
  }

  .nav-links {
    flex-wrap: wrap;
    max-width: 100%;
    gap: 6px;
  }

  .nav-links a {
    min-height: 36px;
    padding: 0 10px;
    border-width: 3px;
    font-size: 0.8rem;
  }

  .hero,
  .bento-grid,
  .skills-band,
  .dialog-meta-grid,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 18px;
    padding: 20px 0 28px;
  }

  .hero h1 {
    margin-top: 10px;
    font-size: clamp(2.2rem, 10vw, 3.2rem);
    line-height: 0.9;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .subtitle {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.35;
  }

  .hero-note {
    margin-top: 10px;
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .socials {
    gap: 10px;
    padding-top: 0;
  }

  .socials a {
    width: 54px;
    border-radius: 15px;
    border-width: 3px;
    box-shadow: 4px 5px 0 var(--line);
  }

  .socials svg {
    width: 30px;
    height: 30px;
  }

  .socials .gmail-mark {
    width: 34px;
  }

  .bento-grid,
  .skills-band {
    gap: 20px;
  }

  .card {
    border-width: 4px;
    border-radius: 24px;
  }

  .intro-card,
  .profile-card,
  .adventure-card,
  .talks-card,
  .plate-card,
  .ai-section,
  .projects-section,
  .skill-card,
  .contact-card {
    padding: 18px;
  }

  .projects-section {
    overflow: hidden;
    padding: 16px 14px 18px;
  }

  .intro-card {
    grid-column: auto;
    min-height: auto;
    padding: 18px;
    transform: none;
  }

  .profile-card {
    min-height: auto;
    padding: 22px 18px 24px;
    justify-content: center;
    transform: none;
  }

  .profile-card::after {
    right: 56px;
    top: auto;
    bottom: 62px;
    width: 5px;
    height: 18px;
    box-shadow: 14px 10px 0 var(--orange);
  }

  .profile-frame {
    width: min(230px, 76%);
    margin-bottom: 20px;
    border-width: 4px;
  }

  .profile-sticker {
    position: relative;
    left: auto;
    bottom: auto;
    margin: -24px auto 0;
    padding: 9px 20px 10px 22px;
    border-width: 4px;
    border-radius: 12px;
    box-shadow: 5px 6px 0 var(--line);
    font-size: 0.96rem;
    transform: rotate(-2deg);
  }

  .profile-sticker::before {
    left: 20px;
    bottom: -20px;
    width: 0;
    height: 0;
    border-top-width: 20px;
    border-right-width: 20px;
  }

  .profile-sticker::after {
    left: 24px;
    bottom: -10px;
    width: 0;
    height: 0;
    border-top-width: 12px;
    border-right-width: 12px;
  }

  .photo-frame {
    aspect-ratio: 1 / 0.82;
  }

  .intro-card .photo-frame {
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    transform: none;
  }

  .intro-card h2,
  .adventure-card h2,
  .plate-card h2,
  .contact-card h2 {
    font-size: clamp(1.65rem, 8vw, 2.45rem);
  }

  .intro-card p,
  .adventure-card p,
  .plate-card p {
    font-size: 0.96rem;
    line-height: 1.55;
  }

  .adventure-card,
  .talks-card,
  .ai-section,
  .plate-card {
    min-height: auto;
  }

  .wide-frame {
    margin-top: 18px;
    aspect-ratio: 16 / 10;
  }

  .talk-list {
    gap: 12px;
  }

  .talk-list li {
    padding: 14px;
    border-width: 3px;
  }

  .ai-section {
    padding: 18px 16px 20px;
  }

  .ai-header {
    grid-template-columns: 1fr;
    gap: 13px;
    margin-bottom: 16px;
  }

  .ai-pill {
    min-height: 34px;
    padding: 8px 15px;
    font-size: 0.86rem;
  }

  .ai-lead {
    font-size: 0.9rem;
    line-height: 1.58;
  }

  .ai-phase-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ai-phase-card {
    min-height: auto;
    padding: 15px 15px 14px;
    border-width: 3px;
    border-radius: 16px;
  }

  .ai-phase-card:hover {
    box-shadow: none;
  }

  .ai-phase-number {
    right: 12px;
    top: 10px;
    font-size: 3.6rem;
  }

  .ai-phase-card h3 {
    font-size: 0.96rem;
  }

  .ai-phase-card strong {
    margin-bottom: 10px;
    font-size: 1.12rem;
  }

  .ai-phase-card strong::after {
    width: 34px;
    height: 2px;
    margin-top: 10px;
  }

  .ai-phase-card p {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .ai-phase-card code {
    margin-top: 8px;
    font-size: 0.72rem;
  }

  .ai-footer {
    margin-top: 18px;
  }

  .ai-footer p {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .ai-footer span {
    font-size: 0.74rem;
    line-height: 1.45;
  }

  .paper-stack {
    width: min(220px, 72%);
  }

  .project-photo,
  .project-photo img {
    min-height: 0;
  }

  .project-photo {
    aspect-ratio: 4 / 3;
    border-width: 4px;
    border-radius: 20px;
    width: 100%;
    max-width: 100%;
    box-shadow: 4px 5px 0 var(--line);
  }

  .project-photo img {
    height: 100%;
  }

  .project-layout {
    width: 100%;
    min-width: 0;
    gap: 18px;
  }

  .project-stack {
    width: 100%;
    min-width: 0;
    gap: 12px;
  }

  .work-highlight-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .work-highlight {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    padding: 15px 14px 16px;
    border-width: 4px;
    border-radius: 17px;
    box-shadow: none;
    overflow: hidden;
  }

  .work-highlight span {
    margin-bottom: 7px;
  }

  .terminal-card {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    overflow: hidden;
    padding: 48px 16px 18px;
    border-width: 4px;
    border-radius: 17px;
    box-shadow: inset 0 29px 0 #1a273a;
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .terminal-dots {
    top: 9px;
    left: 14px;
    z-index: 1;
  }

  .terminal-dots span {
    width: 11px;
  }

  .terminal-card p {
    max-width: 100%;
    margin-bottom: 10px;
  }

  .terminal-card p:not(.terminal-green) {
    display: none;
  }

  .mini-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 10px;
    width: 100%;
    margin-top: 16px;
  }

  .mini-actions button {
    min-width: 0;
    min-height: 40px;
    width: 100%;
    padding: 0 8px;
    border-width: 3px;
    box-shadow: none;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .work-highlight-grid {
    gap: 14px;
  }

  .work-highlight:hover,
  .work-highlight:focus-visible {
    box-shadow: none;
  }

  .work-highlight strong {
    font-size: 0.98rem;
    line-height: 1.22;
  }

  .work-highlight p {
    margin: 8px 0 0;
    font-size: 0.81rem;
    line-height: 1.5;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .skill-card {
    min-height: 150px;
  }

  .skill-card span {
    margin-bottom: 22px;
  }

  .case-dialog {
    width: min(100% - 18px, 680px);
    max-height: calc(100vh - 18px);
    padding: 18px;
    border-width: 4px;
    border-radius: 22px;
  }

  .dialog-banner {
    height: 220px;
    border-width: 4px;
    border-radius: 18px;
  }

  .case-dialog h2 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .contact-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
