/* =========================================================
   Joshua Kraskin — Portfolio
   Direction: "Editorial engineering"
   Serif display (Fraunces) · Sans body (Inter) · Mono labels (IBM Plex Mono)
   ========================================================= */

/* ---- Design tokens ---- */
:root {
    --ink:        #0b0e13;   /* page background, deep cool near-black */
    --ink-2:      #0e131a;
    --panel:      #111823;   /* raised surfaces */
    --panel-2:    #161f2b;   /* chips / hover */
    --line:       #1f2937;   /* hairlines */
    --line-soft:  #172030;
    --text:       #e8edf4;   /* primary text */
    --muted:      #94a1b0;   /* secondary text */
    --faint:      #5b6675;   /* tertiary / gutter numerals */
    --accent:     #e4b457;   /* refined amber — used sparingly */
    --accent-dim: rgba(228, 180, 87, 0.16);

    --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --sans:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono:  'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --maxw: 1120px;
    --ease: cubic-bezier(0.22, 0.68, 0.24, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    background-color: var(--ink);
    color: var(--text);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background-image:
        radial-gradient(1100px 620px at 82% -8%, rgba(228,180,87,0.06), transparent 60%),
        radial-gradient(900px 600px at 8% 4%, rgba(80,120,170,0.05), transparent 55%);
    background-repeat: no-repeat;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 2rem;
}

/* ---- Shared type helpers ---- */
.eyebrow {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 0.85em;
}
.eyebrow::before {
    content: '';
    width: 26px;
    height: 1px;
    background: var(--accent);
    flex: 0 0 auto;
}

.serif { font-family: var(--serif); font-optical-sizing: auto; }

/* =========================================================
   Header
   ========================================================= */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    background: rgba(11, 14, 19, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
}
.site-header .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}
.logo {
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.logo .slash { color: var(--accent); margin-right: 0.35em; }
.logo .dev   { color: var(--muted); }

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}
.nav a {
    position: relative;
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-decoration: none;
    padding: 0.25rem 0;
    transition: color 0.25s var(--ease);
}
.nav a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -2px;
    width: 100%; height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
    padding-top: clamp(8.5rem, 15vh, 12rem);
    padding-bottom: clamp(4rem, 9vw, 7rem);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.9fr;
    align-items: center;
    gap: clamp(2.5rem, 6vw, 5rem);
}
.hero h1 {
    font-family: var(--serif);
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: clamp(2.6rem, 5.6vw, 4.5rem);
    line-height: 1.04;
    letter-spacing: -0.015em;
    color: #fff;
    margin: 0 0 0.9rem;
}
.hero h1 .name { color: var(--accent); }
.hero .eyebrow { margin-bottom: 1.8rem; }
.hero .lede {
    max-width: 46ch;
    font-size: clamp(1.02rem, 1.3vw, 1.15rem);
    color: var(--muted);
    margin-bottom: 2.4rem;
}
.cta-buttons { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.82rem 1.5rem;
    border-radius: 7px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
                border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn.primary { background: var(--accent); color: #14100a; }
.btn.primary:hover { transform: translateY(-2px); background: #eec06b; }
.btn.ghost { border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* Portrait */
.portrait {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin-left: auto;
    aspect-ratio: 4 / 5;
    border-radius: 14px;
    overflow: hidden;
    background: var(--panel);
    box-shadow: 0 30px 60px -22px rgba(0, 0, 0, 0.75);
}
.portrait img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 42%;
}
.portrait::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(228, 180, 87, 0.22);
    pointer-events: none;
}
/* =========================================================
   Section scaffolding + index signature
   ========================================================= */
.section {
    padding-block: clamp(4.5rem, 9vw, 7.5rem);
    scroll-margin-top: 5rem;
}
.section.alt { background: var(--ink-2); border-block: 1px solid var(--line-soft); }

.section-head {
    display: flex;
    align-items: baseline;
    gap: 1.1rem;
    padding-bottom: 1.3rem;
    margin-bottom: 2.8rem;
    border-bottom: 1px solid var(--line);
}
.section-head .index {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.05em;
}
.section-title {
    font-family: var(--serif);
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: #fff;
}
.section-head .aside {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.76rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    align-self: center;
}

/* =========================================================
   Work
   ========================================================= */
.work-grid { display: grid; gap: 1.4rem; }

.work-card {
    position: relative;
    display: block;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 2.1rem 2.2rem;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
                background-color 0.3s var(--ease);
}
.work-card.feature:hover {
    transform: translateY(-3px);
    border-color: rgba(228, 180, 87, 0.4);
    background: #121a26;
}
.work-card .ghost-index {
    position: absolute;
    top: 0.4rem; right: 1.3rem;
    font-family: var(--serif);
    font-size: 5.5rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.035);
    pointer-events: none;
    user-select: none;
}
.work-card .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}
.chip {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: var(--muted);
    background: var(--panel-2);
    border: 1px solid var(--line);
    padding: 0.28rem 0.62rem;
    border-radius: 5px;
}
.work-card h3 {
    font-family: var(--serif);
    font-optical-sizing: auto;
    font-weight: 500;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 0.6rem;
}
.work-card p { color: var(--muted); max-width: 60ch; margin-bottom: 1.4rem; }
.arrow-link {
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.arrow-link .arw { transition: transform 0.25s var(--ease); }
.work-card.feature:hover .arrow-link .arw { transform: translateX(4px); }

.work-card.upcoming {
    background: transparent;
    border: 1px dashed var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 2.2rem;
}
.work-card.upcoming p { margin: 0; color: var(--faint); }
.work-card.upcoming .arrow-link { color: var(--muted); }

/* =========================================================
   Skills
   ========================================================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
}
.skill-block .kicker {
    font-family: var(--mono);
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    display: block;
    margin-bottom: 1.1rem;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.tag {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 0.42rem 0.8rem;
    border-radius: 6px;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
                transform 0.2s var(--ease);
}
.tag:hover { border-color: rgba(228,180,87,0.45); color: var(--accent); transform: translateY(-1px); }

/* =========================================================
   Contact
   ========================================================= */
.contact-inner { max-width: 760px; margin: 0; }
.contact-inner .big {
    font-family: var(--serif);
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -0.015em;
    color: #fff;
    margin: 1.2rem 0 1.1rem;
}
.contact-inner .say { color: var(--muted); max-width: 52ch; margin-bottom: 2.2rem; }
.contact-list { display: flex; flex-direction: column; }
.contact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
    color: var(--text);
    transition: color 0.25s var(--ease);
}
.contact-row:last-child { border-bottom: 1px solid var(--line); }
.contact-row .label { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.contact-row .val { font-family: var(--serif); font-size: clamp(1.15rem, 2vw, 1.5rem); }
.contact-row .val .arw { color: var(--accent); opacity: 0; transform: translateX(-6px); transition: all 0.25s var(--ease); display: inline-block; margin-left: 0.4rem; }
.contact-row:hover { color: var(--accent); }
.contact-row:hover .val .arw { opacity: 1; transform: translateX(0); }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 2rem 0;
}
.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.site-footer p, .site-footer a {
    font-family: var(--mono);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    color: var(--faint);
    text-decoration: none;
}
.site-footer a:hover { color: var(--accent); }

/* =========================================================
   Motion (progressive enhancement — only applies with JS)
   ========================================================= */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.in {
    opacity: 1; transform: none;
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.d1 { transition-delay: 0.08s; }
.js .reveal.d2 { transition-delay: 0.16s; }
.js .reveal.d3 { transition-delay: 0.24s; }

/* Focus + reduced motion (quality floor) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation: none !important; transition: none !important; }
    .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
    .hero-media { order: -1; }
    .portrait { margin: 0 auto; }
    .skills-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 620px) {
    .container { padding: 0 1.4rem; }
    .site-header .bar { height: auto; padding: 0.9rem 0; flex-direction: column; gap: 0.7rem; }
    .nav { gap: 1.5rem; }
    .hero { padding-top: 9.5rem; }
    .section-head { flex-wrap: wrap; }
    .section-head .aside { display: none; }
    .work-card { padding: 1.7rem 1.5rem; }
    .work-card.upcoming { flex-direction: column; align-items: flex-start; }
    .work-card .ghost-index { font-size: 4rem; }
}
