:root {
    --nav-height: 72px;
    --paper: #f4efe3;
    --paper-strong: rgba(248, 244, 234, 0.54);
    --paper-soft: rgba(236, 239, 226, 0.48);
    --ink: #171719;
    --ink-muted: rgba(23, 23, 25, 0.66);
    --ink-faint: rgba(23, 23, 25, 0.14);
    --ai: #16467d;
    --shu: #b63d34;
    --matsuba: #2e6f54;
    --wash: #fbf8ee;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    scroll-behavior: auto;
}

body.new-portfolio {
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    color: var(--ink);
    background: var(--paper);
    font-family: "Zen Kaku Gothic New", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.58;
}

body.new-portfolio::selection {
    color: var(--wash);
    background: var(--ai);
}

#ink-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    background: var(--paper);
}

.new-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

body.new-portfolio main {
    position: fixed;
    top: var(--nav-height);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.new-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(48px, auto) 1fr auto;
    align-items: center;
    gap: 24px;
    width: 100%;
    min-height: var(--nav-height);
    padding: 14px 28px;
    border-bottom: 1px solid var(--ink-faint);
    background: rgba(246, 241, 230, 0.68);
    backdrop-filter: blur(12px) saturate(1.08);
    -webkit-backdrop-filter: blur(12px) saturate(1.08);
}

.new-mark {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--ink);
    color: var(--ink);
    text-decoration: none;
    font-family: "Shippori Mincho", "Yu Mincho", serif;
    font-weight: 700;
    line-height: 1;
}

.new-nav,
.new-actions,
.hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.new-nav {
    justify-content: center;
}

.new-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 10px;
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 180ms ease, background 180ms ease;
}

.new-nav a:hover,
.new-nav a:focus-visible {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.34);
    outline: none;
}

.new-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
    transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.new-action:hover,
.new-action:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.new-action.primary {
    color: var(--wash);
    border-color: var(--ink);
    background: var(--ink);
}

.new-action.secondary {
    background: rgba(246, 241, 230, 0.34);
}

.new-action.secondary:hover,
.new-action.secondary:focus-visible {
    color: var(--wash);
    border-color: var(--ai);
    background: var(--ai);
}

.new-hero {
    display: grid;
    align-items: end;
    min-height: calc(100svh - var(--nav-height));
    padding: 54px 28px 70px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 240px;
    align-items: end;
    gap: 36px;
    width: min(1180px, 100%);
    margin: 0 auto;
}

.vertical-note {
    align-self: stretch;
    margin: 0;
    padding: 8px 0 0;
    border-left: 1px solid rgba(23, 23, 25, 0.28);
    color: var(--ink-muted);
    font-family: "Shippori Mincho", "Yu Mincho", serif;
    writing-mode: vertical-rl;
}

.eyebrow,
.section-heading p {
    margin: 0 0 12px;
    color: var(--shu);
    font-weight: 700;
}

.hero-copy h1 {
    max-width: 850px;
    margin: 0;
    color: var(--ink);
    font-family: "Shippori Mincho", "Yu Mincho", Georgia, serif;
    font-size: 5.25rem;
    line-height: 0.98;
    font-weight: 700;
}

.hero-domain {
    margin: 12px 0 0;
    color: var(--ai);
    font-weight: 700;
}

.hero-summary {
    max-width: 720px;
    margin: 28px 0 0;
    color: rgba(23, 23, 25, 0.76);
    font-size: 1.12rem;
}

.hero-actions {
    flex-wrap: wrap;
    margin-top: 34px;
}

.hero-profile {
    display: grid;
    justify-items: stretch;
    gap: 16px;
    margin: 0;
}

.hero-profile img {
    width: 168px;
    height: 168px;
    justify-self: end;
    border: 1px solid rgba(23, 23, 25, 0.42);
    border-radius: 50%;
    object-fit: cover;
    filter: saturate(0.86) contrast(1.04);
}

.hero-profile p {
    justify-self: end;
    max-width: 220px;
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid rgba(23, 23, 25, 0.24);
    color: var(--ink-muted);
    font-size: 0.95rem;
    text-align: right;
}

.section-band,
.connect-band {
    position: relative;
    scroll-margin-top: 22px;
}

.section-band {
    padding: 94px 28px;
    border-top: 1px solid var(--ink-faint);
    background: linear-gradient(180deg, var(--paper-strong), rgba(248, 244, 234, 0.36));
    backdrop-filter: saturate(1.04);
    -webkit-backdrop-filter: saturate(1.04);
}

.section-band.quiet-band {
    background: linear-gradient(180deg, var(--paper-soft), rgba(236, 239, 226, 0.32));
}

.section-inner {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 60px;
    width: min(1180px, 100%);
    margin: 0 auto;
}

.section-heading {
    position: sticky;
    top: 102px;
    align-self: start;
}

.section-heading h2,
.connect-band h2 {
    margin: 0;
    color: var(--ink);
    font-family: "Shippori Mincho", "Yu Mincho", Georgia, serif;
    font-size: 2.2rem;
    line-height: 1.14;
    font-weight: 700;
}

.ink-list {
    display: grid;
    gap: 0;
}

.ink-entry {
    display: grid;
    grid-template-columns: 142px minmax(0, 1fr);
    gap: 34px;
    padding: 28px 0;
    border-top: 1px solid rgba(23, 23, 25, 0.16);
}

.ink-entry:first-child {
    padding-top: 0;
    border-top: 0;
}

.ink-entry time,
.project-card time {
    color: var(--matsuba);
    font-weight: 700;
}

.entry-body {
    min-width: 0;
}

.entry-body h3,
.project-card h3 {
    margin: 0;
    color: var(--ink);
    font-family: "Shippori Mincho", "Yu Mincho", Georgia, serif;
    font-size: 1.35rem;
    line-height: 1.24;
}

.entry-meta {
    margin: 6px 0 12px;
    color: var(--ai);
    font-weight: 700;
}

.entry-body p,
.project-card p {
    margin: 12px 0 0;
    color: rgba(23, 23, 25, 0.75);
}

.entry-body pre {
    margin: 12px 0 0;
    white-space: pre-wrap;
    color: rgba(23, 23, 25, 0.75);
    font: inherit;
}

.entry-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin-top: 14px;
    color: var(--shu);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.entry-link:hover,
.entry-link:focus-visible {
    color: var(--ai);
    outline: none;
}

.projects-inner {
    align-items: start;
}

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

.project-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid rgba(23, 23, 25, 0.16);
    border-radius: 8px;
    background: rgba(255, 252, 244, 0.50);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.project-card time {
    display: block;
    margin-bottom: 14px;
}

.tech-line {
    color: rgba(23, 23, 25, 0.6);
    font-size: 0.92rem;
}

.connect-band {
    padding: 92px 28px;
    color: var(--wash);
    background: rgba(18, 18, 20, 0.74);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.connect-band .eyebrow {
    color: #e05f50;
}

.connect-band h2 {
    color: var(--wash);
}

.connect-inner {
    display: grid;
    grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
    gap: 56px;
    width: min(1180px, 100%);
    margin: 0 auto;
}

.connect-list {
    display: grid;
    gap: 14px;
}

.connect-list a {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 20px;
    align-items: baseline;
    min-height: 58px;
    padding: 14px 0;
    border-top: 1px solid rgba(251, 248, 238, 0.2);
    color: var(--wash);
    text-decoration: none;
}

.connect-list span {
    color: rgba(251, 248, 238, 0.56);
}

.connect-list strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 1.12rem;
}

.connect-list a:hover strong,
.connect-list a:focus-visible strong {
    color: #e6a05e;
}

.connect-list a:focus-visible {
    outline: 2px solid rgba(251, 248, 238, 0.7);
    outline-offset: 4px;
}

.ink-reset {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 18;
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(23, 23, 25, 0.28);
    border-radius: 50%;
    color: var(--ink);
    background: rgba(246, 241, 230, 0.72);
    cursor: pointer;
    font-family: "Shippori Mincho", "Yu Mincho", serif;
    font-size: 1.1rem;
    font-weight: 700;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 180ms ease, background 180ms ease;
}

.ink-reset:hover,
.ink-reset:focus-visible {
    transform: translateY(-1px);
    background: rgba(255, 252, 244, 0.92);
    outline: none;
}

.new-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    min-height: 82px;
    padding: 24px;
    color: rgba(251, 248, 238, 0.72);
    background: rgba(18, 18, 20, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.new-footer a {
    color: var(--wash);
}

.footer-versions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-versions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(251, 248, 238, 0.24);
    border-radius: 999px;
    color: rgba(251, 248, 238, 0.72);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.footer-versions a:hover,
.footer-versions a:focus-visible {
    color: var(--wash);
    border-color: rgba(251, 248, 238, 0.62);
    background: rgba(251, 248, 238, 0.08);
    outline: none;
}

@media (max-width: 980px) {
    .new-header {
        grid-template-columns: auto 1fr;
    }

    .new-nav {
        display: none;
    }

    .new-actions {
        justify-content: end;
    }

    .hero-grid {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .hero-profile {
        grid-column: 2;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
    }

    .hero-profile img {
        justify-self: start;
        width: 112px;
        height: 112px;
    }

    .hero-profile p {
        justify-self: start;
        text-align: left;
    }

    .section-inner,
    .connect-inner {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .section-heading {
        position: static;
    }

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

@media (max-width: 700px) {
    :root {
        --nav-height: 64px;
    }

    .new-header {
        min-height: var(--nav-height);
        padding: 10px 14px;
    }

    .new-mark {
        width: 40px;
        height: 40px;
    }

    .new-actions {
        gap: 8px;
    }

    .new-action {
        min-width: 0;
        min-height: 40px;
        padding: 0 13px;
        font-size: 0.92rem;
    }

    .new-hero {
        align-items: center;
        min-height: calc(100svh - var(--nav-height));
        padding: 34px 18px 48px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .vertical-note {
        writing-mode: horizontal-tb;
        border-left: 0;
        border-top: 1px solid rgba(23, 23, 25, 0.28);
        padding: 12px 0 0;
    }

    .hero-copy h1 {
        font-size: 3.2rem;
    }

    .hero-summary {
        font-size: 1rem;
    }

    .hero-profile {
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .hero-profile img {
        width: 94px;
        height: 94px;
    }

    .section-band,
    .connect-band {
        padding: 64px 18px;
        scroll-margin-top: 18px;
    }

    .section-heading h2,
    .connect-band h2 {
        font-size: 1.72rem;
    }

    .ink-entry {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 24px 0;
    }

    .entry-body h3,
    .project-card h3 {
        font-size: 1.2rem;
    }

    .project-card {
        padding: 18px;
    }

    .connect-list a {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .ink-reset {
        right: 14px;
        bottom: 14px;
        width: 42px;
        height: 42px;
    }

    .new-footer {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .footer-versions {
        margin-top: 8px;
    }
}

@media (max-width: 430px) {
    .new-actions .secondary {
        display: none;
    }

    .hero-copy h1 {
        font-size: 2.72rem;
    }

    .hero-profile p {
        max-width: 100%;
    }
}

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

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