/* style.css — Lunix :: hard monochrome, Japanese-minimalist rebuild */

@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@400;500;600;700;800&family=Zen+Kaku+Gothic+New:wght@300;400;500;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --black: #0a0a0a;
    --white: #ffffff;
    --red: #b7261b;
    --red-bright: #ff5a42;

    --bg: #fafafa;
    --bg-alt: #f0f0ee;
    --card: #ffffff;
    --card-dark: #f2f2f0;
    --card-line: rgba(10, 10, 10, 0.14);

    --ink: #0a0a0a;
    --ink-light: #5a5a56;
    --ink-soft: #5a5a56;

    --text: var(--ink);
    --text-dark: var(--ink);
    --text-light: var(--ink-light);

    --border: rgba(10, 10, 10, 0.15);
    --border-strong: rgba(10, 10, 10, 0.4);

    --accent: var(--red);
    --accent-text: var(--red);
    --accent-contrast: #ffffff;
    --accent-soft: rgba(183, 38, 27, 0.07);

    --shadow-color: rgba(10, 10, 10, 0.1);
    --shadow-color-strong: rgba(10, 10, 10, 0.16);
    --shadow-onaccent: rgba(183, 38, 27, 0.28);

    --font-display: 'Shippori Mincho', 'Zen Kaku Gothic New', serif;
    --font-body: 'Zen Kaku Gothic New', 'Shippori Mincho', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    --radius: 0px;
    --radius-sm: 0px;
    --radius-lg: 0px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    --rail-w: 84px;
    --rail-w-mobile: 56px;

    --pub-theme-res: var(--red);
    --priv-theme-res: var(--ink-light);
}

html.dark {
    --bg: #0a0a0a;
    --bg-alt: #000000;
    --card: #121211;
    --card-dark: #050504;
    --card-line: rgba(245, 245, 240, 0.14);

    --ink: #f5f5f0;
    --ink-light: #9a9a92;
    --ink-soft: #9a9a92;

    --text: var(--ink);
    --text-dark: #0a0a0a;
    --text-light: var(--ink-light);

    --border: rgba(245, 245, 240, 0.14);
    --border-strong: rgba(245, 245, 240, 0.36);

    --accent: var(--red-bright);
    --accent-text: var(--red-bright);
    --accent-contrast: #0a0a0a;
    --accent-soft: rgba(255, 90, 66, 0.12);

    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-color-strong: rgba(0, 0, 0, 0.68);
    --shadow-onaccent: rgba(255, 90, 66, 0.24);
}

@media (prefers-reduced-motion: reduce) {

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

html.no-transition * {
    transition: none !important;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background 0.3s var(--ease), color 0.3s var(--ease);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-left: var(--rail-w);
}

a {
    color: inherit;
}

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

/* =========================
   BACKGROUND — paper grain, no color glow
========================= */

.background-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

/* =========================
   NAV
========================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.2rem 0;
    z-index: 1000;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-right: 1px solid var(--border);
    overflow: visible;
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 2.8rem;
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 0.3em;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: var(--text);
}

.brand-prompt {
    font-family: var(--font-mono);
    font-size: 0.78em;
    color: var(--accent);
    font-weight: 500;
}

.brand-name {
    color: var(--text);
}

/* =========================
   RAIL NAV — dots that morph into a label bar on hover
========================= */

.nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.9rem;
}

.nav-dot {
    position: relative;
    width: 16px;
    height: 16px;
    display: block;
}

.dot-pill {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--text-light);
    overflow: hidden;
    white-space: nowrap;
    z-index: 2;
    transition: width 0.4s var(--ease), height 0.4s var(--ease), background 0.3s var(--ease), border-radius 0.4s var(--ease), box-shadow 0.3s var(--ease);
}

.dot-pill span {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bg);
    opacity: 0;
    padding-left: 0.9rem;
    padding-right: 0.65rem;
    transition: opacity 0.2s var(--ease);
}

.nav-dot:hover .dot-pill,
.nav-dot.active .dot-pill {
    width: 128px;
    height: 27px;
    background: var(--ink);
    box-shadow: 0 8px 20px -8px var(--shadow-color-strong);
}

.nav-dot:hover .dot-pill span,
.nav-dot.active .dot-pill span {
    opacity: 1;
    transition: opacity 0.2s var(--ease) 0.15s;
}

/* =========================
   NAV DIVIDER
========================= */

.nav-divider {
    height: 3px;
    width: 50px;
    background: var(--text-light);
    opacity: 50%;
}

/* =========================
   THEME TOGGLE
========================= */

.theme-selector {
    margin-top: auto;
}

#theme-trigger {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

#theme-trigger:hover {
    border-color: var(--accent);
    color: var(--accent);
}

#theme-trigger:active {
    transform: translateY(1px);
}

/* =========================
   "BACK TO PORTFOLIO" — sub-page vertical link
========================= */

.nav-vertical-link {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-light);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s var(--ease);
}

.nav-vertical-link:hover {
    color: var(--accent);
}

/* =========================
   MOBILE RAIL -> TOP BAR
========================= */

@media (max-width: 860px) {
    body {
        padding-left: 0 !important;
        padding-top: calc(var(--rail-w-mobile) + 0.4rem);
    }

    .header {
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        height: var(--rail-w-mobile);
        flex-direction: row;
        justify-content: space-between;
        padding: 0 1.1rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .logo {
        margin-bottom: 0;
    }

    .brand-mark {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 1.02rem;
    }

    .nav {
        display: none;
    }

    .theme-selector {
        margin-top: 0;
    }
}

/* =========================
   HERO
========================= */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 9rem clamp(1.25rem, 5vw, 4rem) 5rem;
    max-width: 1320px;
    margin: 0 auto;
}

.hero-content {
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
}

.small-text {
    display: inline-flex;
    align-items: center;
    gap: 0.7em;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-light);
}

.small-text::before {
    content: "";
    width: 20px;
    height: 1px;
    background: var(--accent);
}

.sub-text {
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.typing-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.1rem, 5.2vw, 3.5rem);
    line-height: 1.22;
    letter-spacing: 0.01em;
    width: 100%;
    min-height: 1.22em;
    display: block;
}

#typed-text {
    display: inline-block;
    width: 100%;
}

.cursor {
    display: inline-block;
    width: 2px;
    margin-left: 2px;
    color: var(--accent);
    background: var(--accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

.description {
    max-width: 520px;
    color: var(--text-light);
    font-size: clamp(0.96rem, 1.3vw, 1.04rem);
    line-height: 1.85;
    margin-top: 0.1rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    margin-top: 0.7rem;
}

/* =========================
   BUTTONS
========================= */

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1.9rem;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--bg);
    font-family: var(--font-body);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

html.dark .primary-btn {
    color: var(--bg);
}

.primary-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.95rem 1.7rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-family: var(--font-body);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.ghost-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* =========================
   SECTIONS
========================= */

.projects-section,
.about-section,
.contact-section,
.git-section {
    width: 100%;
    margin: auto;
    padding: 6.5rem clamp(1.25rem, 5vw, 4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content {
    max-width: 1080px;
    width: 100%;
}

.about-section {
    border-top: 1px solid var(--border);
}

.git-section {
    border-top: 1px solid var(--border);
    padding-top: 5.5rem;
    padding-bottom: 5.5rem;
}

.projects-section {
    border-top: 1px solid var(--border);
}

.section-title {
    text-align: center;
    margin-bottom: 3.4rem;
}

.section-title.left-align {
    text-align: left;
}

.section-title p {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.section-title h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: 0.01em;
}

/* =========================
   TECH LIST — plain, static
========================= */

.tech-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 5vw, 4rem) 5.5rem;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
}

.tech-item {
    display: flex;
    align-items: center;
}

.tech-item+.tech-item::before {
    content: "·";
    color: var(--border-strong);
    margin: 0 1.1rem;
    font-size: 1.1rem;
}

.tech-pill {
    color: var(--text-light);
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.2s var(--ease);
}

.tech-pill:hover {
    color: var(--accent);
}

/* =========================
   ABOUT
========================= */

.about-card {
    max-width: 700px;
    margin: 0 auto;
}

.about-card p {
    color: var(--text-light);
    font-size: 0.98rem;
    line-height: 1.95;
}

.about-card p+p {
    margin-top: 1.4em;
}

.about-card strong {
    color: var(--text);
    font-weight: 500;
}

.drop-cap {
    float: left;
    font-family: var(--font-display);
    font-size: 3.2em;
    line-height: 0.82;
    font-weight: 700;
    color: var(--accent);
    margin: 0.03em 0.09em 0 0;
}

/* =========================
   GIT ACTIVITY PANEL
========================= */

.git-commits {
    width: 100%;
}

/* =========================
   PROJECT TABS
========================= */

.proj-tabs {
    display: inline-flex;
    gap: 2.2rem;
    margin-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.proj-tab {
    position: relative;
    padding: 0 0 1rem;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s var(--ease);
}

.proj-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s var(--ease);
}

.proj-tab.active {
    color: var(--text);
}

.proj-tab.active::after {
    transform: scaleX(1);
}

.proj-tab:not(.active):hover {
    color: var(--text);
}

.proj-tab-count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-light);
    margin-left: 0.4em;
}

.proj-tab-desc {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.86rem;
    color: var(--text-light);
    margin: 1.4rem 0 2.4rem;
}

.grid-hidden {
    display: none !important;
}

/* =========================
   PROJECT LOG ROWS
========================= */

.log-rows {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.log-row {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 2.2rem 0;
    border-top: 1px solid var(--border);
}

.log-rows>.log-row:first-child {
    border-top: none;
    padding-top: 0;
}

.log-row-idx {
    flex-shrink: 0;
    width: 2.4rem;
    padding-top: 0.2rem;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-light);
    opacity: 0.5;
}

.log-row-main {
    flex: 1;
    min-width: 0;
}

.log-row-top {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
}

.log-row-top h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
}

.log-row-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-light);
}

.log-row p {
    color: var(--text-light);
    font-size: 0.93rem;
    line-height: 1.8;
    max-width: 600px;
    margin-bottom: 1rem;
}

.log-row .tech-tags {
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.log-row-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem;
}

.log-row-links a {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.86rem;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s var(--ease);
}

.log-row-links a:hover {
    border-color: currentColor;
}

.log-row-thumb {
    flex-shrink: 0;
    width: 176px;
    height: 122px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card-dark);
}

.log-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.05);
    transition: filter 0.25s var(--ease);
}

.log-row:hover .log-row-thumb img {
    filter: grayscale(0.1) contrast(1.02);
}

@media (max-width: 720px) {
    .log-row {
        flex-wrap: wrap;
    }

    .log-row-idx {
        display: none;
    }

    .log-row-thumb {
        order: -1;
        width: 100%;
        height: 170px;
    }
}

/* =========================
   TECH TAGS — neutral, no color noise
========================= */

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    color: var(--text-light);
    transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.tech-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* =========================
   CONTACT SIGN-OFF
========================= */

.contact-section {
    background: var(--ink);
    color: var(--bg);
    border-top: none;
    padding-top: 8rem;
    padding-bottom: 8rem;
}

.contact-signoff {
    max-width: 720px;
    width: 100%;
}

.contact-signoff .small-text {
    color: #b8b5ac;
}

.contact-signoff .small-text::before {
    background: var(--accent);
}

.signoff-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 6.2vw, 3.8rem);
    line-height: 1.16;
    letter-spacing: 0.01em;
    margin: 1.2rem 0 2.4rem;
    color: var(--bg);
}

.accent-dot {
    color: var(--accent);
}

.signoff-email {
    margin-bottom: 3.2rem;
}

.signoff-email a {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    color: var(--bg);
    text-decoration: none;
    border-bottom: 1px solid rgba(250, 250, 250, 0.28);
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.signoff-email a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.email-copy-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.copy-email-btn {
    background: none;
    border: none;
    color: #8f8c85;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0.2rem;
    transition: color 0.2s var(--ease);
}

.copy-email-btn:hover {
    color: var(--accent);
}

.signoff-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    padding-top: 2.6rem;
    border-top: 1px solid rgba(250, 250, 250, 0.14);
}

.contact-item span {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8f8c85;
    margin-bottom: 0.5rem;
}

.contact-item p,
.contact-item a {
    color: var(--bg);
    text-decoration: none;
    line-height: 1.7;
}

.contact-item a:hover {
    color: var(--accent);
}

.no-deco-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
}

.icon {
    margin-right: 0.5rem;
    color: var(--accent);
}

/* =========================
   FOOTER
========================= */

.footer {
    padding: 2.4rem;
    text-align: center;
    color: var(--text-light);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    border-top: 1px solid var(--border);
}

/* =========================
   SMALL HERO (sub-pages)
========================= */

.small-hero {
    min-height: 55vh;
    align-items: flex-start;
    padding-top: 9rem;
    display: flex;
}

.small-hero .hero-content {
    max-width: 100%;
}

.page-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.16;
}

/* =========================
   ABOUT PROJECT (sub-pages)
========================= */

.about-project-section {
    max-width: 860px;
    margin: auto;
    padding: 0 clamp(1.25rem, 5vw, 4rem) 6rem;
}

.about-project-content {
    font-family: var(--font-body);
    font-size: 0.98rem;
    line-height: 1.9;
    color: var(--text-light);
}

.about-project-content p {
    margin-bottom: 1.6rem;
}

.project-image {
    width: 80vw;
    max-width: 700px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    filter: grayscale(1) contrast(1.05);
}

.project-showcase {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    padding: 2rem 0 4rem;
}

.project-showcase .tag-text {
    margin-top: 1.5rem;
}

.tag-text {
    display: inline-block;
    font-family: var(--font-mono);
    color: var(--text-light);
    background: var(--card);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.78rem;
}

/* =========================
   FOCUS
========================= */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {
    .hero {
        min-height: 88vh;
        padding-top: 6.5rem;
    }

    .signoff-meta {
        gap: 1.8rem 2.4rem;
    }
}