/* ═══════════════════════════════════════════════════
   Sam Cox – Portfolio
   ═══════════════════════════════════════════════════ */

/* ── Reset & Variables ────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #070c18;
    --bg2:       #0c1220;
    --surface:   #101827;
    --surface2:  #18243a;
    --border:    #1c2d45;
    --border2:   #253a57;

    --text:      #e2e8f0;
    --text-dim:  #94a3b8;
    --text-muted:#7186a3;

    --accent:    #00d4aa;
    --blue:      #3b82f6;
    --green:     #22c55e;
    --amber:     #f59e0b;

    --mono: 'JetBrains Mono', 'Courier New', monospace;
    --sans: 'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ══════════════════════════════════════════════════
   INTRO OVERLAY
══════════════════════════════════════════════════ */

#intro {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--bg);
    transition: opacity 0.9s ease, visibility 0.9s ease;
}

body.intro-active #intro {
    display: block;
}

#intro.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#skip-btn {
    position: absolute;
    bottom: 28px;
    right: 28px;
    background: transparent;
    border: 1px solid var(--border2);
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

#skip-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

#skip-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ══════════════════════════════════════════════════
   PORTFOLIO
══════════════════════════════════════════════════ */

#portfolio {
    opacity: 1;
    transition: opacity 1s ease 0.3s;
}

body.intro-active #portfolio {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.intro-active #portfolio.visible,
#portfolio.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ── Layout ───────────────────────────────────────── */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 88px 24px;
    border-top: 1px solid var(--border);
}

.section-last { padding-bottom: 140px; }

.section-title {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.prefix { color: var(--accent); margin-right: 6px; }

.body-text {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.85;
    max-width: 700px;
}

/* ── Hero ─────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 80px 24px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 50% at 15% 55%, rgba(0,212,170,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 85% 20%, rgba(59,130,246,0.05) 0%, transparent 70%),
        var(--bg);
}

/* dot-grid overlay */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(0,212,170,0.07) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero-tag {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    margin-bottom: 20px;
}

.hero-inner h1 {
    font-size: clamp(3.2rem, 10vw, 6.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 0.95;
    margin-bottom: 16px;
    background: linear-gradient(140deg, #fff 30%, var(--text-dim) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.hero-links a {
    color: var(--blue);
    transition: color 0.2s;
}
.hero-links a:hover { color: var(--accent); }

.divider { color: var(--border2); }

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    padding: 4px 11px;
    border-radius: 3px;
    border: 1px solid var(--border2);
    color: var(--text-muted);
    background: var(--surface);
}

.badge-green {
    border-color: rgba(34,197,94,0.5);
    color: var(--green);
    background: rgba(34,197,94,0.05);
}

.badge-amber {
    border-color: rgba(245,158,11,0.5);
    color: var(--amber);
    background: rgba(245,158,11,0.05);
}

/* ── Timeline ─────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }

.tl-item {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 0 22px;
    position: relative;
}

/* vertical line */
.tl-item:not(.tl-last)::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 22px;
    bottom: -52px;
    width: 1px;
    background: var(--border);
}

.tl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--accent);
    margin-top: 7px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.tl-body { padding-bottom: 60px; }
.tl-last .tl-body { padding-bottom: 0; }

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 16px;
}

.job-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.job-period {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 3px;
}

.job-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.job-points li {
    position: relative;
    padding-left: 14px;
    color: var(--text-dim);
    font-size: 0.88rem;
    line-height: 1.65;
}

.job-points li::before {
    content: '▸';
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--accent);
    font-size: 0.65rem;
}

/* ── What I Work On ───────────────────────────────── */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
    gap: 14px;
}

.work-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    transition: border-color 0.25s;
}

.work-item:hover { border-color: var(--accent); }

.work-item h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.work-item p {
    font-size: 0.86rem;
    color: var(--text-dim);
    line-height: 1.7;
}

/* ── Currently ───────────────────────────────────── */
.curr-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 700px;
}

.curr-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.25s;
}

.curr-item:hover { border-color: var(--accent); }

.curr-icon {
    color: var(--accent);
    font-size: 0.65rem;
    margin-top: 4px;
    flex-shrink: 0;
}

.curr-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
}

.curr-text {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ── Projects ─────────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 14px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 22px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.25s;
}

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

.proj-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.proj-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.proj-tag {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: 3px;
    border: 1px solid var(--border2);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.tag-teal  { border-color: rgba(0,212,170,0.4);  color: var(--accent); background: rgba(0,212,170,0.05); }
.tag-blue  { border-color: rgba(59,130,246,0.4); color: var(--blue);   background: rgba(59,130,246,0.05); }
.tag-amber { border-color: rgba(245,158,11,0.4); color: var(--amber);  background: rgba(245,158,11,0.05); }
.tag-green { border-color: rgba(34,197,94,0.4);  color: var(--green);  background: rgba(34,197,94,0.05); }

.project-card p {
    font-size: 0.86rem;
    color: var(--text-dim);
    line-height: 1.7;
    flex: 1;
}

.proj-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.proj-tags span {
    font-family: var(--mono);
    font-size: 0.68rem;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text-dim);
}

/* ── Deep Dives ───────────────────────────────────── */
.deep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
    gap: 16px;
}

.deep-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 22px;
}

.deep-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.deep-head h3 {
    font-size: 1rem;
    font-weight: 600;
}

.deep-block {
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.deep-block + .deep-block { margin-top: 14px; }

.deep-block span {
    display: block;
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.deep-block p {
    color: var(--text-dim);
    font-size: 0.86rem;
    line-height: 1.7;
}

/* ── Tools ────────────────────────────────────────── */
.tools-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 760px;
}

.tools-list span {
    font-family: var(--mono);
    font-size: 0.72rem;
    padding: 5px 10px;
    border-radius: 3px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
}

/* ── Skills ───────────────────────────────────────── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
    gap: 14px;
}

.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 20px 18px;
    transition: border-color 0.25s;
}

.skill-card:hover { border-color: var(--accent); }

.skill-card h4 {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tags span {
    font-family: var(--mono);
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text-dim);
}

/* ── Certifications ───────────────────────────────── */
.certs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 580px;
}

.cert-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    border-left-width: 3px;
}

.cert-done     { border-left-color: var(--green); }
.cert-progress { border-left-color: var(--amber); }

.cert-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.cert-info { flex: 1; }

.cert-info h4 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.cert-info span {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.cert-check {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--green);
    flex-shrink: 0;
}

.cert-check.blinking {
    color: var(--amber);
    animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

/* ── Contact ──────────────────────────────────────── */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    max-width: 700px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.contact-card:hover {
    border-color: var(--accent);
    background: var(--surface2);
}

.contact-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.contact-value {
    font-size: 0.88rem;
    color: var(--text);
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
    .section       { padding: 64px 16px; }
    .job-header    { flex-direction: column; }
    .tl-item       { grid-template-columns: 16px 1fr; gap: 0 14px; }
    .hero          { padding: 60px 16px; }
    .hero-links    { flex-direction: column; align-items: flex-start; gap: 6px; }
    .divider       { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
