/* M+ FONT LICENSEのローカル書体だけを読み込み、閲覧時の外部フォント通信を防ぐ。 */
@font-face {
    font-family: "PixelMplus Portfolio";
    font-display: swap;
    font-style: normal;
    font-weight: 400 900;
    src: url("../fonts/PixelMplus12-Regular.ttf") format("truetype");
}

/* 色・余白・共通幅を変数にまとめ、デザイン変更時の修正漏れを防ぐ。 */
:root {
    --color-ink: #f5f1e6;
    --color-ink-soft: #2c3031;
    --color-muted: #c8c3b7;
    --color-surface: #1a1d1e;
    --color-background: #101213;
    --color-accent: #ffd052;
    --color-accent-dark: #ffdc6f;
    --color-line: #3e4242;
    --shadow-card: 0 18px 48px rgb(0 0 0 / 38%), inset 0 1px 0 rgb(255 255 255 / 5%);
    --font-sans: "PixelMplus Portfolio", "Yu Gothic UI", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
    --font-display: "PixelMplus Portfolio", "Yu Gothic UI", "Yu Gothic", sans-serif;
    --font-pixel: "PixelMplus Portfolio", "Yu Gothic UI", monospace;
    --font-size-small: 0.8rem;
    --content-width: 1120px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    margin: 0;
    background-color: var(--color-background);
    background-image:
        linear-gradient(rgb(255 255 255 / 2%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 2%) 1px, transparent 1px);
    background-size: 32px 32px;
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-weight: 500;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: var(--color-accent);
    color: #111;
}

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

a {
    color: inherit;
}

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

a:focus-visible {
    outline: 3px solid var(--color-accent-dark);
    outline-offset: 4px;
}

/* キーボード操作時だけ表示し、本文へ直接移動できるようにする。 */
.skip-link {
    position: fixed;
    z-index: 100;
    top: 12px;
    left: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-ink);
    font-weight: 800;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* 主要セクションの表示幅を揃え、ページ全体の基準線を統一する。 */
.site-header,
.hero,
.works-section,
.skills-section,
footer {
    width: min(var(--content-width), calc(100% - 40px));
    margin-right: auto;
    margin-left: auto;
}

.site-header {
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: space-between;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: clamp(22px, 4vw, 44px);
}

.site-logo {
    display: grid;
    width: 48px;
    height: 48px;
    border: 2px solid #5d6261;
    border-radius: 2px;
    background: #202425;
    color: var(--color-accent);
    font-family: var(--font-pixel);
    font-weight: 800;
    letter-spacing: -0.04em;
    place-items: center;
    text-decoration: none;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: clamp(18px, 4vw, 36px);
}

.site-header nav a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: var(--color-muted);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 180ms ease;
}

.site-header nav a::before {
    content: "// ";
    color: #5d6261;
}

.site-header nav a:hover {
    color: var(--color-ink);
}

.language-switcher {
    display: inline-flex;
    gap: 8px;
    padding: 3px;
    border: 1px solid #555a59;
    border-radius: 2px;
    background: #171a1b;
    box-shadow: inset 0 0 0 2px #101213;
}

.language-switcher button {
    min-width: 68px;
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: 1px;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
    font-family: var(--font-pixel);
    font-size: var(--font-size-small);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.language-switcher button:hover {
    color: var(--color-ink);
}

.language-switcher button.is-active {
    background: var(--color-accent);
    color: #111314;
    box-shadow: inset 0 -3px 0 #9a7513;
}

.language-switcher button:focus-visible,
.project-details summary:focus-visible {
    outline: 3px solid var(--color-accent-dark);
    outline-offset: 3px;
}

.hero {
    position: relative;
    display: grid;
    min-height: 560px;
    grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.55fr);
    gap: clamp(32px, 6vw, 64px);
    align-items: stretch;
    padding: clamp(40px, 6vw, 64px);
    border: 1px solid #4c5150;
    border-radius: 4px;
    background:
        linear-gradient(135deg, rgb(255 255 255 / 3%), transparent 36%),
        repeating-linear-gradient(0deg, transparent 0 7px, rgb(0 0 0 / 8%) 8px),
        #181b1c;
    color: var(--color-ink);
    box-shadow: 0 28px 80px rgb(0 0 0 / 46%), inset 0 0 0 4px #111415;
}

.hero::before,
.hero-visual::before,
.project::before,
.project-card::before,
.compact-card::before,
.skills-section::before {
    position: absolute;
    z-index: 4;
    inset: 0;
    background:
        linear-gradient(#1b1d1e, #1b1d1e) 15px 18px / 10px 2px no-repeat,
        linear-gradient(#1b1d1e, #1b1d1e) calc(100% - 15px) 18px / 10px 2px no-repeat,
        linear-gradient(#1b1d1e, #1b1d1e) 15px calc(100% - 18px) / 10px 2px no-repeat,
        linear-gradient(#1b1d1e, #1b1d1e) calc(100% - 15px) calc(100% - 18px) / 10px 2px no-repeat,
        radial-gradient(circle, #8b8d88 0 5px, #3f4241 6px, transparent 7px) 13px 13px / 14px 14px no-repeat,
        radial-gradient(circle, #8b8d88 0 5px, #3f4241 6px, transparent 7px) calc(100% - 13px) 13px / 14px 14px no-repeat,
        radial-gradient(circle, #8b8d88 0 5px, #3f4241 6px, transparent 7px) 13px calc(100% - 13px) / 14px 14px no-repeat,
        radial-gradient(circle, #8b8d88 0 5px, #3f4241 6px, transparent 7px) calc(100% - 13px) calc(100% - 13px) / 14px 14px no-repeat;
    content: "";
    pointer-events: none;
}

.hero-content {
    align-self: center;
}

.eyebrow {
    margin-bottom: 18px;
    color: var(--color-accent);
    font-size: var(--font-size-small);
    font-family: var(--font-pixel);
    font-weight: 700;
    letter-spacing: 0.18em;
}

.eyebrow-dark {
    color: #64800e;
}

.hero h1 {
    margin-bottom: 0;
    font-size: clamp(3.5rem, 8.5vw, 7rem);
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: 0.02em;
    text-shadow: 4px 4px 0 #08090a;
}

.hero-copy {
    margin: 36px 0 16px;
    font-size: clamp(1.35rem, 2.8vw, 2.15rem);
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: -0.025em;
}

.hero-description {
    max-width: 660px;
    margin-bottom: 0;
    color: var(--color-muted);
    font-size: 1.05rem;
    line-height: 1.9;
}

.hero-actions,
.project-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 20px;
    margin-top: 34px;
}

.button {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 2px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: var(--color-accent);
    color: #111314;
    box-shadow: inset 0 -4px 0 #9a7513;
}

.button-primary:hover {
    background: #ffd34d;
}

.button-secondary {
    border-color: #646866;
    color: var(--color-ink);
}

.button-secondary:hover {
    border-color: #8a9a92;
    background: rgb(255 255 255 / 7%);
}

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

.button-dark:hover {
    background: var(--color-ink-soft);
}

.hero-visual {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    border: 1px solid #555a59;
    border-radius: 2px;
    background: linear-gradient(145deg, #25292a 0%, #101213 100%);
    box-shadow: inset 0 0 0 3px #121415;
}

.hero-number {
    color: var(--color-accent);
    font-size: clamp(5rem, 12vw, 9rem);
    font-family: var(--font-pixel);
    font-weight: 700;
    line-height: 0.85;
    letter-spacing: 0.04em;
}

.hero-label {
    margin-top: 12px;
    color: var(--color-muted);
    font-family: var(--font-pixel);
    font-size: var(--font-size-small);
    font-weight: 700;
    letter-spacing: 0.18em;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 48px;
}

.hero-grid span {
    display: grid;
    min-height: 72px;
    border: 1px solid #484d4c;
    border-radius: 1px;
    background: #181b1c;
    color: var(--color-muted);
    font-family: var(--font-pixel);
    font-size: var(--font-size-small);
    font-weight: 800;
    letter-spacing: 0.12em;
    place-items: center;
}

.works-section {
    padding: clamp(72px, 9vw, 112px) 0;
}

.section-heading {
    display: grid;
    grid-template-columns: minmax(240px, 0.85fr) minmax(280px, 1.15fr);
    gap: 32px;
    align-items: end;
    margin-bottom: 36px;
}

.section-heading h2 {
    margin-bottom: 0;
    font-size: clamp(2.7rem, 6vw, 5rem);
    line-height: 1;
    letter-spacing: -0.06em;
}

.section-heading > p {
    max-width: 540px;
    margin-bottom: 0;
    justify-self: end;
    color: var(--color-muted);
}

.project {
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--color-line);
    border-radius: 28px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}

.project-featured {
    display: grid;
    grid-template-columns: minmax(110px, 0.28fr) minmax(0, 1.72fr);
}

.project-index {
    padding: 44px 32px;
    border-right: 1px solid var(--color-line);
    color: #95a099;
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.08em;
    writing-mode: vertical-rl;
}

.project-body {
    min-width: 0;
    padding: clamp(28px, 5vw, 52px);
}

.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    color: var(--color-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.category {
    margin: 0;
    color: #5e770f;
    font-size: var(--font-size-small);
    font-weight: 800;
    letter-spacing: 0.14em;
}

.project h3,
.project-card h4,
.compact-card h4 {
    color: var(--color-ink);
    font-weight: 800;
    letter-spacing: -0.045em;
}

.project h3 {
    max-width: 760px;
    margin-bottom: 24px;
    font-size: clamp(2.4rem, 6vw, 4.9rem);
    line-height: 1.12;
}

.project-lead {
    max-width: 760px;
    margin-bottom: 34px;
    color: var(--color-muted);
    font-size: clamp(1rem, 2vw, 1.15rem);
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 28px;
    border-top: 1px solid var(--color-line);
    border-bottom: 1px solid var(--color-line);
}

.feature-list div {
    display: flex;
    min-height: 88px;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    border-right: 1px solid var(--color-line);
}

.feature-list div:last-child {
    border-right: 0;
}

.feature-list strong {
    color: var(--color-muted);
    font-size: var(--font-size-small);
    letter-spacing: 0.1em;
}

.feature-list span {
    font-size: 0.95rem;
    font-weight: 700;
}

.project-details {
    max-width: 760px;
    margin: 0 0 28px;
    border: 1px solid var(--color-line);
    background: #141718;
    box-shadow: inset 0 0 18px rgb(0 0 0 / 35%);
}

.project-details summary {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
    color: var(--color-ink);
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

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

.project-details summary::after {
    color: var(--color-accent);
    content: "+";
    font-family: var(--font-pixel);
    font-size: 1.2rem;
}

.project-details[open] summary {
    border-bottom: 1px solid var(--color-line);
}

.project-details[open] summary::after {
    content: "−";
}

.project-details .feature-list {
    margin-bottom: 0;
    border-top: 0;
    border-bottom: 0;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tech-list li {
    padding: 7px 13px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    background: #f8faf6;
    color: #52615a;
    font-size: var(--font-size-small);
    font-weight: 700;
}

.text-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 800;
    text-underline-offset: 5px;
}

.project-media {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

.media-frame {
    position: relative;
    overflow: hidden;
    background: #e8ece5;
}

.video-frame {
    min-height: 520px;
}

.video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.video-consent {
    display: grid;
    width: min(420px, calc(100% - 40px));
    min-height: 220px;
    margin: 20px auto;
    padding: 28px;
    align-content: center;
    justify-items: center;
    gap: 20px;
    color: var(--color-text);
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-line);
}

.video-consent .button {
    min-width: min(240px, 100%);
}

.video-consent .button:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.project-note {
    margin: 20px 0 0;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.subsection-heading {
    display: grid;
    grid-template-columns: minmax(240px, 0.85fr) minmax(280px, 1.15fr);
    gap: 32px;
    align-items: end;
    margin: clamp(68px, 9vw, 96px) 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-line);
}

.subsection-heading h3 {
    margin-bottom: 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.2;
    letter-spacing: -0.045em;
}

.subsection-heading p {
    max-width: 500px;
    margin-bottom: 0;
    justify-self: end;
    color: var(--color-muted);
    font-size: 1rem;
}

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

.project-card {
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: 24px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}

.project-card .media-frame {
    display: grid;
    height: 360px;
    padding: 28px;
    place-items: center;
}

.project-card .media-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 300ms ease;
}

.project-card:hover .media-frame img {
    transform: scale(1.02);
}

.media-frame-dark {
    background: #0a0d0c;
}

.card-body {
    padding: 24px 26px 28px;
}

.card-body .project-meta {
    margin-bottom: 16px;
}

.project-card h4 {
    margin-bottom: 12px;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.project-card p {
    margin-bottom: 0;
    color: var(--color-muted);
    font-size: 1rem;
}

.card-link {
    margin-top: 18px;
}

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

.compact-card {
    display: grid;
    min-height: 210px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 20px;
    align-items: start;
    padding: 26px;
    border: 1px solid var(--color-line);
    border-radius: 22px;
    background: var(--color-surface);
}

.compact-number {
    color: #a1aaa5;
    font-size: var(--font-size-small);
    font-weight: 800;
}

.compact-card h4 {
    margin: 18px 0 12px;
    font-size: 1.45rem;
    line-height: 1.35;
}

.compact-card div > p:last-child {
    margin-bottom: 0;
    color: var(--color-muted);
    font-size: 0.96rem;
}

.compact-card > a {
    display: grid;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-accent);
    font-size: 1.1rem;
    font-weight: 800;
    place-items: center;
    text-decoration: none;
    transition: background-color 180ms ease, transform 180ms ease;
}

.compact-card > a:hover {
    background: #d7ff74;
    transform: translateY(-2px);
}

.skills-section {
    margin-bottom: 40px;
    padding: clamp(40px, 6vw, 64px);
    border-radius: 30px;
    background: var(--color-ink);
    color: var(--color-surface);
}

.skills-section .section-heading {
    margin-bottom: 32px;
}

.skills-section .section-heading > p {
    color: #bdc9c3;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid #42534c;
    border-bottom: 1px solid #42534c;
}

.skills-grid article {
    min-height: 160px;
    padding: 24px;
    border-right: 1px solid #42534c;
}

.skills-grid article:last-child {
    border-right: 0;
}

.skills-grid span {
    color: var(--color-accent);
    font-size: var(--font-size-small);
    font-weight: 800;
}

.skills-grid h3 {
    margin: 30px 0 8px;
    font-size: 1.35rem;
}

.skills-grid p {
    margin-bottom: 0;
    color: var(--color-muted);
    font-size: 0.96rem;
}

footer {
    display: flex;
    min-height: 130px;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    color: var(--color-muted);
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 0;
}

.footer-name {
    color: var(--color-ink);
    font-size: 1.2rem;
    font-weight: 800;
}

footer a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    text-decoration: none;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.policy-main {
    width: min(920px, calc(100% - 40px));
    margin: 0 auto;
    padding: 64px 0 96px;
}

.policy-header,
.policy-section {
    padding: 28px;
    border: 1px solid var(--color-line);
    background: var(--color-surface);
}

.policy-header {
    margin-bottom: 24px;
}

.policy-section + .policy-section {
    margin-top: 24px;
}

.policy-section h2,
.policy-section h3 {
    margin-top: 1.5em;
}

.policy-section h2:first-child,
.policy-section h3:first-child {
    margin-top: 0;
}

.policy-section li + li {
    margin-top: 0.6em;
}

.policy-main a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
}

/*
 * INDUSTRIAL SKIN
 * カラム数・幅・余白は保ったまま、表面の材質と文字表現だけを工場設備風にする。
 */
.site-header {
    border-bottom: 1px solid #343838;
    box-shadow: 0 1px 0 #050606;
}

.category,
.hero-label,
.skills-grid span,
.compact-number {
    font-family: var(--font-pixel);
}

.site-header nav a:hover,
.text-link,
footer a {
    color: var(--color-accent);
}

.hero h1,
.hero-copy,
.section-heading h2,
.project h3,
.subsection-heading h3,
.project-card h4,
.compact-card h4,
.skills-grid h3,
.footer-name {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.04em;
}

html[lang="en"] .hero h1,
html[lang="en"] .project h3,
html[lang="en"] .project-card h4,
html[lang="en"] .compact-card h4 {
    overflow-wrap: anywhere;
    text-wrap: balance;
}

html[lang="en"] .hero h1 {
    font-size: clamp(3.2rem, 7vw, 6.2rem);
}

html[lang="en"] .project h3 {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
}

.hero-copy {
    text-shadow: 2px 2px 0 #050606;
}

.eyebrow-dark,
.category {
    color: var(--color-accent);
}

.button-dark {
    border-color: #595e5d;
    background: #272b2c;
    color: var(--color-ink);
    box-shadow: inset 0 -4px 0 #111314;
}

.button-dark:hover {
    background: #34393a;
}

.works-section {
    position: relative;
}

.works-section::before {
    position: absolute;
    top: 48px;
    right: 0;
    left: 0;
    height: 7px;
    border: 1px solid #4a421f;
    background: repeating-linear-gradient(135deg, var(--color-accent) 0 10px, #17191a 10px 20px);
    box-shadow: 0 2px 0 #050606;
    content: "";
    opacity: 0.72;
}

.section-heading h2,
.subsection-heading h3 {
    color: var(--color-ink);
    text-shadow: 3px 3px 0 #050606;
}

.section-heading > p,
.subsection-heading p,
.project-lead,
.project-card p,
.compact-card div > p:last-child {
    color: var(--color-muted);
}

.project,
.project-card,
.compact-card,
.skills-section {
    position: relative;
    border-color: #494e4d;
    border-radius: 3px;
    background-color: var(--color-surface);
    background-image:
        linear-gradient(145deg, rgb(255 255 255 / 3%), transparent 32%),
        repeating-linear-gradient(0deg, transparent 0 8px, rgb(0 0 0 / 7%) 9px);
    box-shadow: var(--shadow-card), inset 0 0 0 3px #121415;
}

.project:hover,
.project-card:hover,
.compact-card:hover {
    border-color: #666b69;
}

.project-index {
    border-color: var(--color-line);
    background:
        repeating-linear-gradient(135deg, #171a1b 0 8px, #1d2021 8px 16px);
    color: var(--color-accent);
    font-family: var(--font-pixel);
    font-weight: 400;
    text-shadow: 3px 3px 0 #080909;
}

.project-body,
.card-body {
    position: relative;
    z-index: 1;
    background: rgb(24 27 28 / 90%);
}

.project-meta {
    color: var(--color-muted);
}

.project h3,
.project-card h4,
.compact-card h4 {
    color: var(--color-ink);
    text-shadow: 2px 2px 0 #050606;
}

.feature-list {
    border-color: var(--color-line);
    background: #141718;
    box-shadow: inset 0 0 18px rgb(0 0 0 / 35%);
}

.feature-list div {
    border-color: var(--color-line);
}

.feature-list strong {
    color: var(--color-accent);
    font-family: var(--font-pixel);
}

.tech-list li {
    border-color: #4b504f;
    border-radius: 2px;
    background: #111415;
    color: #ded9cd;
    font-family: var(--font-pixel);
    box-shadow: inset 0 -2px 0 #080909;
}

.text-link {
    font-family: var(--font-sans);
}

.media-frame {
    border-color: #444948;
    background-color: #111415;
    background-image:
        linear-gradient(45deg, rgb(255 255 255 / 2%) 25%, transparent 25%),
        linear-gradient(-45deg, rgb(255 255 255 / 2%) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgb(255 255 255 / 2%) 75%),
        linear-gradient(-45deg, transparent 75%, rgb(255 255 255 / 2%) 75%);
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}

.video-frame {
    border-right: 1px solid var(--color-line);
}

.subsection-heading {
    border-color: var(--color-line);
    box-shadow: 0 1px 0 #050606;
}

.card-body {
    border-top: 1px solid var(--color-line);
}

.compact-card {
    background-color: #1a1d1e;
}

.compact-card > a {
    border: 1px solid #f5cc4e;
    border-radius: 2px;
    background: var(--color-accent);
    color: #111314;
    box-shadow: inset 0 -4px 0 #9a7513;
}

.compact-card > a:hover {
    background: #ffd34d;
}

.skills-section {
    background-color: #171a1b;
    color: var(--color-ink);
}

.skills-section .section-heading > p {
    color: var(--color-muted);
}

.skills-grid {
    border-color: #4b504f;
    background: #111415;
    box-shadow: inset 0 0 22px rgb(0 0 0 / 42%);
}

.skills-grid article {
    border-color: #4b504f;
}

.skills-grid h3 {
    color: var(--color-ink);
    text-shadow: 2px 2px 0 #050606;
}

.skills-grid p {
    color: var(--color-muted);
}

footer {
    border-top: 1px solid #343838;
    color: var(--color-muted);
    box-shadow: inset 0 1px 0 #050606;
}

.footer-name {
    color: var(--color-ink);
}

/* 文字が窮屈になる前に2カラムを解除し、タブレットでも可読性を保つ。 */
@media (max-width: 900px) {
    .hero {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .hero-visual {
        min-height: 250px;
    }

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

    .video-frame {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .feature-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-list div:nth-child(2) {
        border-right: 0;
    }

    .feature-list div:nth-child(-n + 2) {
        border-bottom: 1px solid var(--color-line);
    }
}

/* モバイルでは情報を縦に並べ、リンクのタップ領域を十分に確保する。 */
@media (max-width: 680px) {
    .site-header,
    .hero,
    .works-section,
    .skills-section,
    footer {
        width: min(100% - 24px, var(--content-width));
    }

    .site-header {
        display: grid;
        min-height: 0;
        grid-template-columns: auto 1fr;
        gap: 10px 16px;
        padding: 12px 0;
    }

    .header-actions {
        display: contents;
    }

    .site-header nav {
        grid-row: 2;
        grid-column: 1 / -1;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 8px;
    }

    .site-header nav a {
        font-size: 0.82rem;
    }

    .language-switcher {
        grid-row: 1;
        grid-column: 2;
        justify-self: end;
    }

    .hero {
        gap: 40px;
        padding: 42px 24px 24px;
        border-radius: 3px;
    }

    .hero h1 {
        font-size: clamp(2.75rem, 14vw, 4rem);
        letter-spacing: 0.02em;
    }

    html[lang="en"] .hero h1 {
        font-size: clamp(2.35rem, 10vw, 3.4rem);
    }

    .hero-copy br {
        display: none;
    }

    .hero-actions .button {
        width: 100%;
    }

    .hero-grid span {
        min-height: 58px;
    }

    .works-section {
        padding: 88px 0;
    }

    .section-heading,
    .subsection-heading {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .section-heading > p,
    .subsection-heading p {
        justify-self: start;
    }

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

    .project-index {
        padding: 24px;
        border-right: 0;
        border-bottom: 1px solid var(--color-line);
        font-size: 3rem;
        writing-mode: initial;
    }

    .project-body {
        padding: 28px 22px 34px;
    }

    .project h3 {
        font-size: clamp(2.2rem, 12vw, 3.5rem);
    }

    .feature-list div {
        min-height: 82px;
        padding: 14px;
    }

    .project-details .feature-list {
        grid-template-columns: 1fr;
    }

    .project-details .feature-list div,
    .project-details .feature-list div:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--color-line);
    }

    .project-details .feature-list div:last-child {
        border-bottom: 0;
    }

    .project-links {
        align-items: flex-start;
        flex-direction: column;
    }

    .project-grid,
    .compact-grid,
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .project-card .media-frame {
        height: 300px;
        padding: 20px;
    }

    .compact-card {
        min-height: 230px;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .compact-card > a {
        grid-column: 2;
    }

    .skills-section {
        padding: 44px 24px;
        border-radius: 3px;
    }

    .skills-grid article {
        min-height: 150px;
        border-right: 0;
        border-bottom: 1px solid var(--color-line);
    }

    .skills-grid article:last-child {
        border-bottom: 0;
    }

    .skills-grid h3 {
        margin-top: 28px;
    }

    footer {
        min-height: 150px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
    }
}

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
