:root {
    --bg: #07100f;
    --bg-alt: #0d1715;
    --bg-card: #0f1c1a;
    --teal: #14b8a6;
    --teal-bright: #2dd4bf;
    --text: #eef5f4;
    --muted: #8aa19d;
    --border: rgba(45, 212, 191, 0.16);
    --font-display: 'Sora', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: hidden;
}

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

h1, h2, h3 {
    font-family: var(--font-display);
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--teal);
    letter-spacing: .02em;
    margin-bottom: 14px;
}

.section-lead {
    color: var(--muted);
    max-width: 620px;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* NAVBAR */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 50px;
    height: 80px;
    border-bottom: 1px solid var(--border);
}

nav .left a {
    color: var(--text);
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
}

nav .left .dot {
    color: var(--teal-bright);
}

nav .right a {
    color: var(--muted);
    margin-left: 28px;
    font-size: 15px;
    transition: color .15s;
}

nav .right a:hover {
    color: var(--text);
}

nav .right .cta-link {
    color: var(--bg);
    background-color: var(--teal-bright);
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
}

nav .right .cta-link:hover {
    color: var(--bg);
    filter: brightness(1.08);
}

/* SECTION 1: Hero */
.hero-section {
    padding: 80px 50px 60px;
}

.hero-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.hero-section .text {
    flex: 5;
}

.hero-section .text h1 {
    font-size: 46px;
    font-weight: 800;
    line-height: 1.18;
    margin-bottom: 22px;
    letter-spacing: -0.01em;
}

.cursor {
    color: var(--teal-bright);
    animation: blink 1.1s steps(1) infinite;
}

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

.hero-section .lead {
    color: var(--muted);
    font-size: 17px;
    max-width: 540px;
    line-height: 1.65;
}

.hero-section .text .links {
    margin-top: 30px;
}

.hero-section .text .links a {
    display: inline-block;
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    margin-right: 12px;
    margin-bottom: 10px;
    transition: .15s;
    color: var(--text);
}

.hero-section .text .links a:hover {
    border-color: var(--teal-bright);
    color: var(--teal-bright);
}

.hero-section .headshot {
    flex: 2;
    display: flex;
    justify-content: right;
}

.headshot-frame {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    padding: 4px;
    background: conic-gradient(from 180deg, var(--teal), transparent 60%, var(--teal-bright));
}

.headshot-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--bg);
    display: block;
}

/* WORK SECTION + SYSTEM MAP (signature element) */
.work-section {
    padding: 60px 50px 100px;
    border-top: 1px solid var(--border);
}

.work-section h2,
.skills-section h2,
.testimony-section h2,
.contact-section h2 {
    font-size: 34px;
    margin-bottom: 14px;
}

.system-map {
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 40px 30px 30px;
    margin-bottom: 50px;
}

.node {
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-card);
    padding: 14px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.node-label {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

.node-sub {
    font-size: 11px;
    color: var(--muted);
}

.node.core {
    width: 260px;
    margin: 0 auto;
    border-color: var(--teal);
    background-color: rgba(20, 184, 166, 0.08);
}

.node.core .node-label {
    color: var(--teal-bright);
    font-size: 14px;
}

.map-lines {
    width: 100%;
    height: 80px;
    display: block;
}

.map-lines path {
    fill: none;
    stroke: var(--border);
    stroke-width: 1.5;
}

.node-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: -1px;
}

.node.leaf {
    flex: 1;
}

/* PROJECT CAROUSEL */
.carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 30px;
}

.carousel-viewport {
    overflow: hidden;
    flex: 1;
    border-radius: 10px;
}

.project-grid {
    display: flex;
    gap: 24px;
    transition: transform .4s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}

.carousel-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background-color: var(--bg-alt);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s, color .15s;
}

.carousel-btn:hover {
    border-color: var(--teal-bright);
    color: var(--teal-bright);
}

.carousel-btn:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
}

.carousel-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background-color: var(--border);
    cursor: pointer;
    padding: 0;
    transition: background-color .2s, transform .2s;
}

.carousel-dots .dot.active {
    background-color: var(--teal-bright);
    transform: scale(1.3);
}

.project-card {
    flex: 0 0 calc(50% - 12px);
    border: 1px solid var(--border);
    border-radius: 10px;
    background-color: var(--bg-alt);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: var(--text);
    transition: border-color .15s, transform .15s;
    text-decoration: none;
}

a.project-card:hover {
    border-color: var(--teal-bright);
    transform: translateY(-3px);
}

.project-card-empty {
    opacity: .55;
    pointer-events: none;
}

.project-thumb {
    aspect-ratio: 16 / 9;
}

.project-thumb .placeholder {
    height: 100%;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
}

.project-thumb .placeholder img {
    border-radius: 0;
}

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

.project-card-body h3 {
    font-size: 19px;
}

.project-card-body p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.view-link {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--teal-bright);
    margin-top: 4px;
}

.view-link i {
    margin-left: 4px;
    transition: transform .15s;
}

a.project-card:hover .view-link i {
    transform: translateX(3px);
}

/* PROJECT DETAIL PAGE */
.project-header {
    padding: 60px 50px 30px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 26px;
}

.back-link:hover {
    color: var(--teal-bright);
}

.inline-back {
    margin-top: 24px;
}

.project-header h1 {
    font-size: 38px;
    margin-bottom: 16px;
}

.project-header .lead {
    color: var(--muted);
    max-width: 640px;
    line-height: 1.6;
    font-size: 16px;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 34px;
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.meta-value {
    font-size: 14.5px;
}

.project-shot-section {
    padding: 0 50px 60px;
}

.large-placeholder {
    aspect-ratio: 16 / 7;
    border-radius: 10px;
}

.avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 12px;
    border: 2px solid var(--teal);
    font-size: 28px;
}

/* project gallery placeholders */
.project-gallery {
    display: flex;
    gap: 20px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.shot-slot {
    flex: 1;
    min-width: 220px;
}

.placeholder {
    position: relative;
    aspect-ratio: 4 / 3;
    border: 1.5px dashed var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    padding: 12px;
    overflow: hidden;
}

.placeholder i {
    font-size: 22px;
    color: var(--teal);
}

.placeholder img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* fallback icon/text are hidden once a real image loads */
.placeholder img:not([style*="display: none"]) ~ i,
.placeholder img:not([style*="display: none"]) ~ span {
    display: none;
}

/* case study */
.case-study {
    display: flex;
    gap: 60px;
    border-top: 1px solid var(--border);
    padding-top: 36px;
}

.case-col {
    flex: 1;
}

.case-study h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--teal-bright);
}

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

.case-list li {
    position: relative;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.55;
    font-size: 14.5px;
}

.case-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--teal);
}

.case-list code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--teal-bright);
    background-color: var(--bg-card);
    padding: 1px 6px;
    border-radius: 3px;
}

.stack-col {
    flex: 0 0 240px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tag {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--teal-bright);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 5px 10px;
}

.repo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    transition: .15s;
}

.repo-link:hover {
    border-color: var(--teal-bright);
    color: var(--teal-bright);
}

/* SECTION: Skills */
.skills-section {
    padding: 60px 50px 100px;
    border-top: 1px solid var(--border);
}

.skills-section .cells {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

.skills-section .cells .cell {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 190px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-alt);
}

.skills-section .cells .cell img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 2px;
}

.cell-icon {
    width: 26px;
    font-size: 22px;
    color: var(--teal-bright);
    text-align: center;
}

.skills-section .cells .cell span {
    font-size: 15px;
}

/* SECTION: Testimony */
.testimony-section {
    padding: 60px 50px 100px;
    border-top: 1px solid var(--border);
}

.testimony-section .group {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-top: 30px;
}

.testimony-section .group .person-details {
    text-align: center;
    flex: 2;
}

.testimony-section .group .person-details img,
.testimony-section .group .person-details .person-photo {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 12px;
    border: 2px solid var(--teal);
    background-color: var(--bg-card);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.testimony-section .group .person-details p {
    font-weight: 600;
}

.testimony-section .group .person-details .role {
    font-weight: normal;
    color: var(--muted);
    font-size: 14px;
}

.testimony-section .group blockquote.text {
    flex: 8;
    font-size: 19px;
    line-height: 1.6;
    color: var(--text);
    border-left: 2px solid var(--teal);
    padding-left: 24px;
}

/* SECTION: Contact */
.contact-section {
    padding: 60px 50px 110px;
    border-top: 1px solid var(--border);
}

.contact-section .group {
    display: flex;
    gap: 50px;
    margin-top: 30px;
}

.contact-section .group .text {
    flex: 3;
    color: var(--muted);
    line-height: 1.6;
}

.contact-direct {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.contact-direct a {
    color: var(--text);
    font-size: 14.5px;
}

.contact-direct a:hover {
    color: var(--teal-bright);
}

.contact-section .group form {
    flex: 3;
    display: flex;
    flex-direction: column;
}

.contact-section .group form label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.contact-section .group form input,
.contact-section .group form textarea {
    font-family: var(--font-body);
    color: var(--text);
    border: 1px solid var(--border);
    background-color: var(--bg-alt);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 18px;
    outline: none;
    resize: none;
    transition: border-color .15s;
}

.contact-section .group form input:focus,
.contact-section .group form textarea:focus {
    border-color: var(--teal-bright);
}

.contact-section .group form button {
    font-size: 15px;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--bg);
    background-color: var(--teal-bright);
    border: none;
    border-radius: 6px;
    height: 50px;
    cursor: pointer;
    transition: .15s;
}

.contact-section .group form button:hover {
    filter: brightness(.92)
}

/* FEATURE GRID (Arire page) */
.feature-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.feature-card {
    flex: 1;
    min-width: 240px;
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-icon {
    font-size: 22px;
    color: var(--teal-bright);
}

.feature-card h3 {
    font-size: 16px;
}

.feature-card p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.55;
}

/* avatar fallback for testimony photos */
.avatar-fallback {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 2px solid var(--teal);
    background-color: var(--bg-card);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--muted);
    margin: 0 auto 12px;
}

/* FEATURE GRID */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--teal-bright);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .cursor { animation: none; }
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .case-study {
        flex-direction: column;
        gap: 30px;
    }
    .stack-col { flex: 1; }
    .node-row { flex-wrap: wrap; }
    .node.leaf { min-width: 45%; }
}

@media (max-width: 850px) {
    .hero-section .text h1 { font-size: 36px; }
}

@media (max-width: 740px) {
    .hero-grid { flex-direction: column-reverse; }
    .headshot-frame { width: 220px; height: 220px; }
    .testimony-section .group { flex-direction: column; }
    .testimony-section .group blockquote.text { border-left: none; padding-left: 0; border-top: 2px solid var(--teal); padding-top: 18px; }
    .contact-section .group { flex-direction: column; }
    .node-row { flex-direction: column; }
    .map-lines { display: none; }
}

@media (max-width: 600px) {
    nav { padding: 0 20px; }
    nav .right a:not(.cta-link) { display: none; }
    .hero-section,
    .work-section,
    .skills-section,
    .testimony-section,
    .contact-section,
    .project-header,
    .project-shot-section {
        padding-left: 20px;
        padding-right: 20px;
    }
    .hero-section .text h1 { font-size: 28px; }
    .project-gallery { flex-direction: column; }
    .project-grid { flex-direction: column; }
    .project-header h1 { font-size: 28px; }
}