/* =====================================================
   Watercolor design system — shared across all pages
   ===================================================== */

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

:root {
    --paper: oklch(0.995 0.004 75);
    --paper-deep: oklch(0.975 0.012 70);
    --text: oklch(0.28 0.015 55);
    --muted: oklch(0.50 0.015 55);
    --border: oklch(0.85 0.020 60);

    --rose: oklch(0.62 0.11 25);
    --rose-soft: oklch(0.78 0.08 25);
    --ochre: oklch(0.72 0.11 75);
    --ochre-soft: oklch(0.86 0.07 80);
    --sage: oklch(0.62 0.06 145);
    --sage-soft: oklch(0.82 0.05 145);

    --accent: var(--rose);
    --wash-opacity: 0.55;
    --paper-grain: 0.06;
}

/* Selection: native chrome is blank; the JS overlay paints the wash */
::selection      { background: transparent; color: var(--text); }
::-moz-selection { background: transparent; color: var(--text); }

.wc-selection-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.wc-sel-blob {
    position: absolute;
    background:
      radial-gradient(ellipse 55% 70% at 30% 45%, color-mix(in oklab, var(--rose-soft) 90%, transparent), transparent 72%),
      radial-gradient(ellipse 50% 65% at 75% 55%, color-mix(in oklab, var(--ochre-soft) 85%, transparent), transparent 70%),
      linear-gradient(100deg, color-mix(in oklab, var(--rose-soft) 55%, transparent), color-mix(in oklab, var(--ochre-soft) 60%, transparent));
    filter: url(#wc-rough) blur(0.5px);
    border-radius: 6px 10px 4px 12px / 10px 4px 12px 6px;
    mix-blend-mode: multiply;
    opacity: 0.85;
}
.wc-sel-blob::after {
    content:'';
    position:absolute;
    inset: 45% -4px -4px 8%;
    background: radial-gradient(ellipse 70% 100% at 50% 100%, color-mix(in oklab, var(--rose) 40%, transparent), transparent 70%);
    filter: url(#wc-rough) blur(0.7px);
    opacity: 0.55;
    border-radius: inherit;
}

html, body { background: var(--paper); }

body {
    font-family: 'EB Garamond', serif;
    color: var(--text);
    line-height: 1.8;
    font-size: 18px;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse 60vw 50vh at 15% 0%, color-mix(in oklab, var(--ochre-soft) 22%, transparent), transparent 60%),
      radial-gradient(ellipse 70vw 60vh at 110% 30%, color-mix(in oklab, var(--rose-soft) 18%, transparent), transparent 55%),
      radial-gradient(ellipse 80vw 70vh at 50% 120%, color-mix(in oklab, var(--sage-soft) 18%, transparent), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0 0.15 0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    opacity: var(--paper-grain);
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 1;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 60px;
    position: relative;
    z-index: 2;
}

/* ===== Nav ===== */
nav {
    position: fixed;
    top: 40px;
    right: 60px;
    z-index: 100;
    font-family: 'Libre Franklin', sans-serif;
    font-size: 14px;
    letter-spacing: 0.3px;
}
nav a {
    color: var(--text);
    text-decoration: none;
    margin-left: 30px;
    position: relative;
    transition: color 0.2s ease;
    padding-bottom: 6px;
}
nav a::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    bottom: 0;
    height: 6px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 8' preserveAspectRatio='none'><path d='M2 4 Q 15 1, 30 4 T 60 5 T 78 3' stroke='%23b3604e' stroke-width='2.2' fill='none' stroke-linecap='round' opacity='0.85'/></svg>");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
nav a::after { content: none; display: none; }
nav a:hover { color: var(--accent); }
nav a:hover::before { opacity: 1; transform: translateY(0); }
nav a.current::before { opacity: 0.9; transform: translateY(0); }

/* ===== Typography ===== */
h1 {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 56px;
    font-weight: 300;
    letter-spacing: -1px;
    margin-bottom: 40px;
    line-height: 1.1;
    color: var(--text);
    position: relative;
    display: inline-block;
    padding: 20px 28px 22px;
    isolation: isolate;
}

.h1-wash {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

h2 {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 24px;
    font-weight: 500;
    margin: 70px 0 10px 0;
    letter-spacing: -0.3px;
    color: var(--text);
    position: relative;
    display: block;
}
h2 > span.h2-inner { display: inline-block; position: relative; }
h2 > span.h2-inner::after {
    content: '';
    display: block;
    width: 110%;
    height: 10px;
    margin-top: 4px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'><path d='M3 5 Q 30 1.5, 60 5 T 120 6 T 180 4 T 197 5.5' stroke='%23b3604e' stroke-width='2.5' fill='none' stroke-linecap='round' opacity='0.75'/><path d='M6 6.5 Q 40 4, 80 6.5 T 160 5.5 T 195 7' stroke='%23c89a5a' stroke-width='1.3' fill='none' stroke-linecap='round' opacity='0.45'/></svg>");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

h3 {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--accent);
}

p { margin-bottom: 20px; color: var(--text); }

/* ===== Bracket links with sage watercolor pool on hover ===== */
a {
    color: var(--accent);
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
    font-weight: 500;
    z-index: 0;
}
a::before { content: '['; margin-right: 2px; color: var(--text); }
a::after  { content: '→]'; margin-left: 2px; color: var(--text); display: inline-block; transition: transform 0.25s ease; }

a .bleed {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(0.3) rotate(-2deg);
    width: 130%;
    height: 240%;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    background:
      radial-gradient(ellipse 60% 70% at 50% 55%, color-mix(in oklab, var(--sage-soft) 95%, transparent), color-mix(in oklab, var(--sage) 25%, transparent) 55%, transparent 78%);
    filter: url(#wc-rough) blur(0.4px);
    mix-blend-mode: multiply;
    border-radius: 8px 14px 6px 16px / 12px 6px 16px 8px;
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.2,.8,.3,1.2);
}
a .bleed::after {
    content: '';
    position: absolute;
    inset: 40% 8% -6% 12%;
    background: radial-gradient(ellipse 70% 100% at 50% 100%, color-mix(in oklab, var(--sage) 55%, transparent), transparent 72%);
    filter: url(#wc-rough) blur(0.5px);
    opacity: 0.7;
    border-radius: inherit;
}
a:hover .bleed {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1) rotate(-1deg);
}
a:hover::after { transform: translateX(3px); }
a:hover { color: color-mix(in oklab, var(--sage) 35%, var(--accent)); }

/* Nav links: plain, no brackets */
nav a::before, nav a::after { content: ''; margin: 0; }
nav a::after { display: none; }

/* ===== Card with painted edge ===== */
.card {
    margin: 40px 0;
    position: relative;
    background: transparent;
    padding: 2px;
}
.card-frame {
    position: absolute;
    inset: -4px;
    pointer-events: none;
    z-index: 0;
    border-radius: 6px 10px 8px 12px / 10px 6px 12px 8px;
    background:
      linear-gradient(color-mix(in oklab, var(--paper) 90%, var(--ochre-soft)), color-mix(in oklab, var(--paper) 90%, var(--ochre-soft))) padding-box,
      repeating-linear-gradient(
        to right,
        color-mix(in oklab, var(--rose) 55%, transparent) 0 8px,
        color-mix(in oklab, var(--ochre) 45%, transparent) 8px 14px,
        transparent 14px 20px
      ) border-box;
    border: 2px solid transparent;
    filter: url(#wc-rough);
    opacity: 0.9;
}
.card-frame::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px dashed color-mix(in oklab, var(--rose) 35%, transparent);
    border-radius: inherit;
    opacity: 0.55;
}

.card-content {
    padding: 32px;
    position: relative;
    z-index: 1;
    background: color-mix(in oklab, var(--paper) 92%, var(--ochre-soft));
}
.card-tabs {
    display: flex;
    position: relative;
    z-index: 1;
    background: color-mix(in oklab, var(--paper) 82%, var(--ochre-soft));
    border-top: 1px dashed color-mix(in oklab, var(--rose) 35%, transparent);
}
.card-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--muted);
    position: relative;
}
.card-tab:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0; top: 25%; bottom: 25%;
    width: 1px;
    background: color-mix(in oklab, var(--rose) 25%, transparent);
}
.card-tab:hover {
    color: var(--text);
    background: color-mix(in oklab, var(--rose-soft) 18%, transparent);
}
.card-tab.active {
    color: var(--accent);
    font-weight: 500;
    background: color-mix(in oklab, var(--paper) 70%, var(--rose-soft));
}
.card-tab.active::before {
    content: '';
    position: absolute;
    top: -2px; left: 10%; right: 10%;
    height: 4px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 4' preserveAspectRatio='none'><path d='M2 2 Q 20 0.5, 40 2 T 78 2' stroke='%23b3604e' stroke-width='2.5' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(2px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    margin: -20px 0 50px 4px;
    font-style: italic;
}

/* ===== Skill chips ===== */
.skills-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    padding: 8px 16px;
    color: var(--text);
    position: relative;
    background: transparent;
    isolation: isolate;
}
.skill-tag::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 14px 20px 16px 22px / 20px 14px 22px 16px;
    background: color-mix(in oklab, var(--ochre-soft) 75%, var(--paper));
    filter: url(#wc-rough);
    opacity: 0.85;
}
.skill-tag:nth-child(3n+2)::before { background: color-mix(in oklab, var(--rose-soft) 65%, var(--paper)); }
.skill-tag:nth-child(3n+3)::before { background: color-mix(in oklab, var(--sage-soft) 70%, var(--paper)); }

/* ===== Brushstroke + divider ===== */
.accent-line {
    width: 180px;
    height: 14px;
    margin: 30px 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'><path d='M4 7 Q 30 2, 60 7 T 120 8 T 180 6 T 197 8' stroke='%23b3604e' stroke-width='3' fill='none' stroke-linecap='round' opacity='0.8'/><path d='M8 9 Q 50 6, 100 9 T 195 8.5' stroke='%23c89a5a' stroke-width='1.5' fill='none' stroke-linecap='round' opacity='0.5'/></svg>");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-color: transparent !important;
    border: none !important;
}

.section-divider {
    width: 100%;
    height: 18px;
    margin: 50px 0 30px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 18' preserveAspectRatio='none'><path d='M4 10 Q 80 4, 160 10 T 320 11 T 480 9 T 596 10' stroke='%23b3604e' stroke-width='1.6' fill='none' stroke-linecap='round' opacity='0.55'/><path d='M10 12 Q 120 9, 240 12 T 460 11.5 T 592 12.5' stroke='%23c89a5a' stroke-width='0.9' fill='none' stroke-linecap='round' opacity='0.35'/></svg>");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.footer-note {
    margin-top: 100px;
    padding-top: 30px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--muted);
    position: relative;
}
.footer-note::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 8px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 8' preserveAspectRatio='none'><path d='M2 4 Q 100 1, 200 4 T 400 5 T 596 3' stroke='%23b3604e' stroke-width='1.2' fill='none' stroke-linecap='round' opacity='0.5'/></svg>");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

/* ===== Tweaks panel ===== */
.tweaks-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 280px;
    background: color-mix(in oklab, var(--paper) 94%, var(--ochre-soft));
    padding: 18px 18px 16px;
    z-index: 200;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--text);
    display: none;
    box-shadow: 0 6px 24px color-mix(in oklab, var(--rose) 15%, transparent);
}
.tweaks-panel.open { display: block; }
.tweaks-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: inherit;
    filter: url(#wc-rough);
    border-radius: 4px 12px 6px 14px / 10px 4px 14px 6px;
}
.tweaks-title {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tweaks-title .close {
    background: none; border: none; cursor: pointer;
    font-family: inherit; font-size: 14px; color: var(--muted);
}
.tweak-group { margin-bottom: 14px; }
.tweak-label { text-transform: uppercase; letter-spacing: 0.5px; font-size: 10px; color: var(--muted); margin-bottom: 6px; }
.tweak-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tweak-btn {
    font-family: inherit;
    font-size: 11px;
    padding: 6px 10px;
    border: 1px solid color-mix(in oklab, var(--rose) 25%, transparent);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
}
.tweak-btn:hover { background: color-mix(in oklab, var(--rose-soft) 25%, transparent); }
.tweak-btn.active { background: color-mix(in oklab, var(--rose-soft) 60%, var(--paper)); border-color: var(--rose); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container { padding: 60px 24px; }
    nav { position: static; margin-bottom: 30px; text-align: center; right: auto; top: auto; }
    nav a { margin: 0 12px; }
    h1 { font-size: 38px; padding: 12px 16px; }
    h2 { font-size: 22px; margin: 50px 0 8px 0; }
    .card-content { padding: 22px; }
    .tweaks-panel { width: calc(100vw - 32px); right: 16px; bottom: 16px; }
}
