:root {
    --ink: #100e0b;
    --ink2: #1a1712;
    --paper: #f4ede1;
    --crimson: #c23f31;
    --crimson-text: #d25b4e;
    --crimson-soft: rgba(194, 63, 49, 0.14);
    --gold: #c9a961;
    --muted: #9c9186;
    --border: #2c2822;
    --max-width: 900px;
    --max-width-wide: 1100px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--ink);
    color: var(--paper);
    line-height: 1.65;
    font-size: 16px;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Shippori Mincho', serif;
}

.mono {
    font-family: 'Space Mono', monospace;
}

a {
    color: var(--crimson-text);
    text-decoration: none;
}

a:hover {
    color: #a5352a;
}

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--crimson);
    color: #fff;
    padding: 10px 18px;
    border-radius: 0 0 8px 0;
    z-index: 100;
    font-weight: 600;
}

.skip-link:focus {
    left: 0;
}

.summary-text {
    color: var(--muted);
    margin-bottom: 16px;
}

.summary-text:last-child {
    margin-bottom: 0;
}

.cta-center {
    justify-content: center;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 0 24px;
}

/* Nav */

.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    background: rgba(16, 14, 11, 0.85);
    backdrop-filter: blur(10px);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.logo {
    font-family: 'Shippori Mincho', serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--paper);
}

.logo:hover {
    color: var(--paper);
}

.nav-links {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--paper);
}

/* Hero (homepage only) */

header {
    position: relative;
    padding: 90px 0 60px;
    overflow: hidden;
}

.seigaiha-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(circle at 50% 100%, transparent 62%, rgba(194, 63, 49, 0.07) 63%, rgba(194, 63, 49, 0.07) 68%, transparent 69%);
    background-size: 64px 32px;
    opacity: .6;
    mask-image: radial-gradient(ellipse 85% 70% at 30% 45%, black, transparent 78%);
}

.circuit-lines {
    position: absolute;
    inset: -10%;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(115deg, rgba(201, 169, 97, 0.06) 0 1px, transparent 1px 96px),
        repeating-linear-gradient(25deg, rgba(201, 169, 97, 0.045) 0 1px, transparent 1px 140px);
    animation: circuit-drift 34s linear infinite;
}

@keyframes circuit-drift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 420px 220px, -320px 260px; }
}

.helmet-watermark {
    position: absolute;
    right: -8%;
    bottom: -10%;
    width: min(60vw, 860px);
    opacity: .07;
    color: var(--paper);
    pointer-events: none;
}

.vertical-strip {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    font-family: 'Shippori Mincho', serif;
    font-size: 15px;
    color: var(--muted);
    letter-spacing: .3em;
    opacity: .7;
    display: none;
}

.shuriken-real {
    position: absolute;
    right: 10%;
    top: 13%;
    width: 48px;
    height: 48px;
    z-index: 2;
    color: var(--gold);
    animation: shuriken-spin 14s linear infinite;
}

@keyframes shuriken-spin {
    from { transform: rotate(0); }
    to { transform: rotate(360deg); }
}

.kamon {
    position: absolute;
    z-index: 2;
    width: 300px;
    height: 300px;
    right: 6%;
    top: 8%;
}

.kamon .ring-outer,
.kamon .ring-inner {
    fill: none;
    stroke: var(--gold);
    stroke-dasharray: 2000;
}

.kamon .ring-outer {
    stroke-width: 5;
    opacity: .55;
}

.kamon .ring-inner {
    stroke-width: 2;
    opacity: .4;
}

@media (min-width: 1100px) {
    .vertical-strip { display: block; }
}

@media (max-width: 1100px) {
    .kamon, .shuriken-real { display: none; }
}

.hud-panel {
    position: relative;
    display: inline-block;
    padding: 13px 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(201, 169, 97, 0.35);
    background: rgba(16, 14, 11, 0.55);
    backdrop-filter: blur(4px);
    overflow: hidden;
}

.hud-panel .corner {
    position: absolute;
    width: 9px;
    height: 9px;
    border-color: var(--gold);
}

.hud-panel .c-tl { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.hud-panel .c-tr { top: -1px; right: -1px; border-top: 2px solid; border-right: 2px solid; }
.hud-panel .c-bl { bottom: -1px; left: -1px; border-bottom: 2px solid; border-left: 2px solid; }
.hud-panel .c-br { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

.hud-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.seal-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--crimson);
    color: #fff;
    font-family: 'Shippori Mincho', serif;
    font-size: 13px;
    flex-shrink: 0;
}

.hud-panel .txt {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--paper);
    text-transform: uppercase;
}

.hud-panel .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7bd88f;
    box-shadow: 0 0 8px #7bd88f;
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

.hud-scan {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    animation: hud-scan-move 2.6s linear infinite;
    opacity: .6;
}

@keyframes hud-scan-move {
    0% { top: 0%; }
    100% { top: 100%; }
}

.hero-inner {
    position: relative;
    z-index: 3;
    max-width: 680px;
}

@media (min-width: 1100px) {
    .hero-inner { margin-left: 66px; }
}

/* page-header (about / projects / contact) */

.page-header {
    padding: 64px 0 40px;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.page-header p {
    font-size: 18px;
    color: var(--muted);
    max-width: 700px;
}

/* Brush-stroke underline — used inside any h1 */

.brush-wrap {
    position: relative;
    display: inline-block;
}

.brush-underline {
    position: absolute;
    left: -2%;
    bottom: -8px;
    width: 104%;
    height: 16px;
}

.brush-underline path {
    fill: none;
    stroke: var(--crimson);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 2000;
}

h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.lead {
    font-size: 20px;
    color: var(--muted);
    max-width: 700px;
    margin-bottom: 24px;
}

.location {
    color: var(--muted);
    font-size: 15px;
}

.cta-group {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 22px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--crimson);
    color: #fff;
}

.btn-primary:hover {
    background: #a5352a;
    color: #fff;
}

.btn-secondary {
    background: transparent;
    color: var(--paper);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* Sections + katana-edge divider */

section {
    padding: 60px 0;
}

.blade-divider {
    display: block;
    width: 100%;
    height: 36px;
    margin-bottom: -1px;
}

.blade-divider path {
    fill: none;
    stroke: url(#bladeGrad);
    stroke-width: 2;
    stroke-dasharray: 2000;
    filter: drop-shadow(0 0 5px rgba(194, 63, 49, 0.55));
}

h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--crimson-text);
    margin-bottom: 24px;
    font-weight: 600;
}

.mark-katana {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--crimson);
}

h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.card {
    background: var(--ink2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 28px;
}

.card .jp {
    font-family: 'Shippori Mincho', serif;
    font-size: 22px;
    color: var(--crimson-text);
    margin-bottom: 12px;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.card p {
    color: var(--muted);
    font-size: 15px;
}

/* Work-history write-up cards (About page) */

.project {
    background: var(--ink2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 24px;
}

.project:last-child {
    margin-bottom: 0;
}

.project-meta {
    font-size: 13px;
    color: var(--crimson-text);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project p {
    color: var(--muted);
    margin-bottom: 16px;
}

.project ul {
    margin-left: 18px;
    color: var(--muted);
    font-size: 15px;
}

.project li {
    margin-bottom: 8px;
}

/* Project showcase cards (Projects page + Home teaser strip) */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--ink2);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s ease;
}

.project-card:hover {
    border-color: var(--crimson);
}

.thumb-wrap {
    position: relative;
    border-bottom: 1px solid var(--border);
}

.project-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}

.thumb-wrap .bracket {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: var(--gold);
    opacity: .7;
    pointer-events: none;
}

.thumb-wrap .b-tl { top: 10px; left: 10px; border-top: 2px solid; border-left: 2px solid; }
.thumb-wrap .b-tr { top: 10px; right: 10px; border-top: 2px solid; border-right: 2px solid; }
.thumb-wrap .b-bl { bottom: 10px; left: 10px; border-bottom: 2px solid; border-left: 2px solid; }
.thumb-wrap .b-br { bottom: 10px; right: 10px; border-bottom: 2px solid; border-right: 2px solid; }

.project-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.project-card h3 {
    font-size: 18px;
    margin-bottom: 0;
}

.project-card .stack-line {
    font-size: 12px;
    color: var(--gold);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: 'Space Mono', monospace;
}

.project-card ul {
    margin-left: 18px;
    color: var(--muted);
    font-size: 14px;
    flex: 1;
}

.project-card li {
    margin-bottom: 6px;
}

.project-card .status-line {
    font-size: 13px;
    color: var(--muted);
}

.project-card .live-link {
    align-self: flex-start;
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
}

.section-cta {
    margin-top: 32px;
}

/* Timeline */

.timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-title {
    font-weight: 600;
    font-size: 17px;
}

.timeline-meta {
    color: var(--muted);
    font-size: 14px;
}

/* Skills */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.skill-category {
    background: var(--ink2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 22px;
}

.skill-category h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--paper);
    margin-bottom: 10px;
}

.skill-category p {
    color: var(--muted);
    font-size: 14px;
}

/* Certifications */

.cert-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cert-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: var(--ink2);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 15px;
}

.cert-list .cert-date {
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

/* Contact links */

.contact-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 8px;
}

.contact-link-card {
    background: var(--ink2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.contact-link-card .label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.contact-link-card a {
    font-size: 17px;
    font-weight: 600;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Contact section (Home) */

.contact {
    text-align: center;
    padding: 80px 0;
}

.contact h2 {
    margin-bottom: 16px;
    justify-content: center;
}

.contact p {
    color: var(--muted);
    font-size: 18px;
    margin-bottom: 28px;
}

footer {
    padding: 32px 0;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.credit {
    font-size: 11px;
    color: #5a544a;
    margin-top: 10px;
}

@media (max-width: 600px) {
    h1 { font-size: 34px; }
    .page-header h1 { font-size: 30px; }
    .lead { font-size: 17px; }
    .grid-3 { grid-template-columns: 1fr; }
    .cert-list li { flex-direction: column; gap: 4px; }
    header { padding: 60px 0 40px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
    .circuit-lines, .hud-scan, .status-dot, .shuriken-real { animation: none !important; }
}
