/* ============================================================
   kawalec.pl v3 — "From Prompt to Product"
   terminal/generative aesthetic · readability first
   dark #0b0b0c · lime #DDF160 · amethyst #9F8BE7
   JetBrains Mono + Funnel Display + Mozilla Text
   ============================================================ */

:root {
    --bg: #0b0b0c;
    --win: #131316;
    --win-bar: #1a1a1e;
    --line: #26262b;
    --line-soft: rgba(255, 255, 255, 0.06);
    --text: #e9e9e4;
    --text-dim: #9a9aa0;
    --lime: #ddf160;
    --violet: #9f8be7;
    --ok: #7ee787;
    --font-display: "Funnel Display", sans-serif;
    --font-body: "Mozilla Text", Georgia, serif;
    --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
    --wrap: 1160px;
    --pad: clamp(20px, 4vw, 56px);
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 17.5px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }

.mono {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.01em;
}

.accent { color: var(--lime); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); width: 100%; }

/* syntax tokens */
.t-mark { color: var(--lime); }
.t-key { color: var(--violet); }
.t-fn { color: var(--lime); }
.t-arg { color: var(--text-dim); font-style: italic; }
.t-arrow { color: var(--violet); }
.t-ret { color: var(--text); }
.t-ok { color: var(--ok); }
.t-dim { color: var(--text-dim); }
.t-sys { color: var(--text-dim); }
.t-sys .t-mark { color: var(--violet); }

/* caret */
.caret {
    display: inline-block;
    width: 9px;
    height: 1.15em;
    background: var(--lime);
    vertical-align: text-bottom;
    margin-left: 3px;
    animation: caret-blink 1.05s steps(1) infinite;
}

@keyframes caret-blink { 50% { opacity: 0; } }

/* ---------- atmosphere: drizzle + crt ---------- */

#drizzle {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
}

.crt {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background:
        repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px),
        radial-gradient(ellipse 130% 110% at 50% 40%, transparent 60%, rgba(0, 0, 0, 0.42) 100%);
}

body.lite #drizzle, body.reduced #drizzle { display: none; }

/* ---------- nav ---------- */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px clamp(16px, 3vw, 40px);
    background: rgba(11, 11, 12, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
}

.nav-logo { display: flex; align-items: center; gap: 14px; }
.nav-logo img { height: 22px; width: auto; }
.nav-session { color: var(--text-dim); }

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

.nav-link { color: var(--text-dim); transition: color 0.2s ease; position: relative; }
.nav-link::before { content: "./"; opacity: 0; transition: opacity 0.2s ease; color: var(--lime); }
.nav-link:hover { color: var(--text); }
.nav-link:hover::before { opacity: 1; }

.nav-twin {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid rgba(221, 241, 96, 0.4);
    border-radius: 7px;
    color: var(--lime);
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-twin:hover { background: var(--lime); color: #111; }

.nav-twin-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: twin-pulse 2s ease-in-out infinite;
}

@keyframes twin-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@media (max-width: 920px) {
    .nav-links, .nav-session { display: none; }
}

/* ---------- window chrome ---------- */

.window {
    background: var(--win);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
    position: relative;
    z-index: 5;
}

.window-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    background: var(--win-bar);
    border-bottom: 1px solid var(--line);
}

.window-dots { display: flex; gap: 7px; }
.window-dots i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #313137;
}
.window-dots i:nth-child(1) { background: #3e3e45; }
.window-dots i:nth-child(2) { background: var(--violet); opacity: 0.55; }
.window-dots i:nth-child(3) { background: var(--lime); opacity: 0.55; }

.window-title { color: var(--text-dim); }
.window-meta { margin-left: auto; color: var(--text-dim); opacity: 0.7; }

.window-body { padding: clamp(22px, 3vw, 40px); }

/* ---------- sections ---------- */

main { position: relative; z-index: 10; }

.sec {
    padding: clamp(90px, 14vh, 150px) 0;
    position: relative;
}

.sec-prompt {
    color: var(--text);
    font-size: 15px;
    margin-bottom: 28px;
    min-height: 1.5em;
}

.sec-title {
    font-family: var(--font-display);
    font-weight: 450;
    font-size: clamp(26px, 3.2vw, 40px);
    line-height: 1.12;
    letter-spacing: -0.01em;
    margin-bottom: 28px;
}

/* ---------- hero ---------- */

.sec-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: clamp(110px, 16vh, 170px);
}

.window-hero { max-width: 980px; margin: 0 auto; width: 100%; }

.t-line { margin-bottom: 10px; font-size: 14px; }
.t-line:first-child { font-size: 15px; }

.hero-output { margin-top: 30px; }

.hero-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(46px, 7.5vw, 96px);
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 22px;
}

.hero-sub {
    font-size: clamp(17px, 1.7vw, 21px);
    max-width: 52ch;
    margin-bottom: 14px;
}

.hero-sub strong, .hero-note strong { color: var(--lime); font-weight: 500; }

.hero-note { color: var(--text-dim); max-width: 60ch; }

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

.hero-social {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px dashed var(--line);
    color: var(--text-dim);
}

.hero-social a { transition: color 0.2s ease; }
.hero-social a:hover { color: var(--lime); }
.hero-exp { margin-left: auto; color: var(--violet); }

.scroll-hint {
    text-align: center;
    color: var(--text-dim);
    margin-top: 26px;
    animation: hint-drift 2.4s ease-in-out infinite;
}

@keyframes hint-drift {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    padding: 13px 22px;
    border-radius: 8px;
    font-size: 13.5px;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

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

.btn-solid { background: var(--lime); color: #111; }
.btn-solid:hover { background: #eaff7a; }

.btn-ghost { border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--lime); color: var(--lime); }

/* ---------- about ---------- */

.about-grid {
    display: grid;
    grid-template-columns: minmax(240px, 360px) 1fr;
    gap: clamp(22px, 3vw, 40px);
    align-items: start;
}

.about-photo img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    filter: grayscale(30%);
    transition: filter 0.45s ease;
}

.about-photo-win:hover .about-photo img { filter: grayscale(0%); }

.about-photo { position: relative; }

.about-photo figcaption {
    position: absolute;
    left: 12px;
    bottom: 10px;
    color: var(--lime);
    background: rgba(11, 11, 12, 0.78);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.about-copy p { margin-bottom: 18px; color: var(--text); }
.about-copy p:last-child { margin-bottom: 0; }
.about-copy strong { color: var(--lime); font-weight: 500; }
.about-copy .accent { color: var(--violet); }

/* epochs (timeline) */

.epochs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 26px;
}

.epoch {
    background: var(--win);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px 22px;
    position: relative;
    z-index: 5;
}

.epoch-tag { color: var(--text-dim); display: block; margin-bottom: 10px; font-size: 12px; }

.epoch h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 18px;
    margin-bottom: 6px;
}

.epoch p { font-size: 11.5px; color: var(--text-dim); }

.epoch-now { border-color: rgba(221, 241, 96, 0.5); }
.epoch-now .epoch-tag { color: var(--lime); }

@media (max-width: 1000px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-photo-win { max-width: 360px; }
    .epochs { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
    .epochs { grid-template-columns: 1fr; }
}

/* ---------- approach (system prompt) ---------- */

.code-body { padding: clamp(16px, 2.4vw, 30px) clamp(18px, 2.6vw, 34px); }

.rule {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px dashed var(--line);
}

.rule:last-of-type { border-bottom: 0; }

.rule-ln { color: var(--text-dim); opacity: 0.6; padding-top: 5px; }

.rule-name {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(19px, 2vw, 24px);
    margin-bottom: 8px;
}

.rule-content p { color: var(--text); max-width: 72ch; }

.rule-quote {
    padding: 22px 0 6px 60px;
    color: var(--text-dim);
    font-style: italic;
    max-width: 78ch;
}

@media (max-width: 640px) {
    .rule { grid-template-columns: 30px 1fr; }
    .rule-quote { padding-left: 0; }
}

/* ---------- services (tools) ---------- */

.tools-body { padding: 8px clamp(14px, 2vw, 24px); }

.tool {
    display: block;
    padding: 20px 10px;
    border-bottom: 1px dashed var(--line);
    transition: background 0.2s ease;
}

.tool:last-child { border-bottom: 0; }
.tool:hover { background: rgba(255, 255, 255, 0.02); }

.tool-head {
    display: flex;
    align-items: baseline;
    gap: 18px;
}

.tool-ln { color: var(--text-dim); opacity: 0.6; flex: none; }

.tool-sig {
    font-weight: 500;
    font-size: clamp(14px, 1.7vw, 19px);
    line-height: 1.45;
    flex: 1;
    transition: color 0.2s ease;
}

.tool-toggle { color: var(--text-dim); flex: none; transition: transform 0.3s ease, color 0.2s ease; }
.tool:hover .tool-toggle { color: var(--lime); transform: rotate(90deg); }

.tool-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    opacity: 0;
    color: var(--text-dim);
    margin-left: 44px;
}

.tool-detail li { padding: 3px 0; }
.tool-detail li::before { content: "+ "; color: var(--violet); }

.tool:hover .tool-detail, .tool:focus-visible .tool-detail {
    max-height: 120px;
    opacity: 1;
    margin-top: 12px;
}

@media (max-width: 640px) {
    .tool-detail { margin-left: 0; }
    .tool-head { flex-wrap: wrap; gap: 10px; }
}

/* ---------- projects (outputs) ---------- */

.projects-pin { position: relative; }

.projects-track {
    display: flex;
    gap: clamp(20px, 2.6vw, 36px);
    padding: 30px var(--pad) 40px;
    width: max-content;
}

.project {
    width: clamp(300px, 34vw, 470px);
    flex: none;
    transition: transform 0.35s ease, border-color 0.35s ease;
}

.project:hover { transform: translateY(-6px); border-color: rgba(221, 241, 96, 0.45); }

.project-prompt {
    padding: 16px 18px 0;
    color: var(--text-dim);
    font-size: 12.5px;
}

.project-prompt::after { content: "▌"; color: var(--lime); opacity: 0.7; margin-left: 4px; }

.project-img {
    margin: 14px 18px 0;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #0e0e10;
    border: 1px solid var(--line);
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.project:hover .project-img img { transform: scale(1.04); }

.project-foot { padding: 16px 18px 20px; }

.project-meta { color: var(--text-dim); display: block; margin-bottom: 8px; font-size: 12px; }

.project-foot h3 {
    font-family: var(--font-display);
    font-weight: 450;
    font-size: clamp(16px, 1.5vw, 19px);
    line-height: 1.32;
    transition: color 0.25s ease;
}

.project:hover .project-foot h3 { color: var(--lime); }

/* mobile / no-pin: vertical stack */
@media (max-width: 1023px) {
    .projects-track {
        flex-direction: column;
        width: auto;
        max-width: var(--wrap);
        margin: 0 auto;
    }
    .project { width: 100%; max-width: 560px; margin: 0 auto; }
}

/* log (other notable work) */

.log-win { margin-top: clamp(36px, 6vh, 60px); }

.log-body { padding: 16px clamp(18px, 2.6vw, 34px); }

.log-body li {
    padding: 11px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.6;
}

.log-body li:last-child { border-bottom: 0; }
.log-body li > .t-dim:first-child { display: inline-block; min-width: 92px; }

/* ---------- contact ---------- */

.contact-win { max-width: 880px; margin: 0 auto; }

.contact-body { text-align: center; padding: clamp(34px, 5vw, 64px) clamp(22px, 4vw, 56px); }

.contact-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(34px, 5vw, 64px);
    line-height: 1.02;
    letter-spacing: -0.015em;
    margin-bottom: 18px;
}

.contact-sub { color: var(--text-dim); max-width: 52ch; margin: 0 auto 36px; }

.contact-promptline {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 34px;
    padding: 18px 22px;
    background: #0e0e10;
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.contact-promptline:hover {
    border-color: rgba(221, 241, 96, 0.55);
    box-shadow: 0 0 0 4px rgba(221, 241, 96, 0.07);
}

.contact-placeholder { color: var(--text-dim); font-size: 14px; }

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-bottom: 30px;
}

.contact-mail { color: var(--text-dim); font-size: 15.5px; }
.contact-mail .accent { border-bottom: 1px solid rgba(221, 241, 96, 0.4); padding-bottom: 1px; }

/* footer */

.footer { margin-top: clamp(70px, 12vh, 130px); border-top: 1px solid var(--line-soft); padding: 22px 0 56px; }

.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--text-dim);
}

.footer-left { display: inline-flex; align-items: center; gap: 12px; }
.footer-logo { height: 18px; width: auto; opacity: 0.85; display: inline-block; }

.footer-links { display: inline-flex; gap: 20px; }
.footer-links a:hover { color: var(--lime); }

/* ---------- status bar ---------- */

.statusbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px clamp(16px, 3vw, 40px);
    background: rgba(13, 13, 15, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    color: var(--text-dim);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

#status-tokens { color: var(--lime); }

@media (max-width: 700px) {
    .status-mid { display: none; }
}

/* ---------- modes ---------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .caret, .nav-twin-dot, .scroll-hint { animation: none; }
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}
