/* ---------------------------------------------------------
   Tokens
--------------------------------------------------------- */
:root {
    --bg:            #0F1720;
    --panel:         #16202B;
    --border:        #28394A;
    --line:          #223244;
    --text:          #E7ECF1;
    --text-muted:    #8CA0B3;
    --accent:        #E8A33D;
    --accent-dim:    #B98432;

    --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --head: 'Space Grotesk', var(--sans);

    --max-width: 880px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------------------------------------------------------
   Top bar
--------------------------------------------------------- */
.topbar {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(15, 23, 32, 0.92);
    backdrop-filter: blur(6px);
    z-index: 10;
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 16px;
}

.topbar__brand {
    font-family: var(--head);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
}
.topbar__brand:hover { text-decoration: none; color: var(--accent); }

.topbar__nav a {
    color: var(--text-muted);
    margin-left: 24px;
    font-size: 0.95rem;
}
.topbar__nav a:hover { color: var(--text); text-decoration: none; }

/* ---------------------------------------------------------
   Hero
--------------------------------------------------------- */
.hero {
    padding: 64px 24px 48px;
}

.schema-label {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 14px;
}

.record {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--border);
    background: var(--panel);
    margin-bottom: 40px;
}

.record__field {
    padding: 14px 16px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.record__field:last-child { border-right: none; }

.record__field .col {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}
.record__field .val {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.val--accent { color: var(--accent); }

.hero__headline {
    font-family: var(--head);
    font-weight: 600;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.25;
    margin: 0 0 20px;
    max-width: 18ch;
}

.hero__lede {
    color: var(--text-muted);
    max-width: 60ch;
    font-size: 1.05rem;
}

/* ---------------------------------------------------------
   Sections
--------------------------------------------------------- */
.section {
    padding: 48px 24px;
    border-top: 1px solid var(--line);
}

.section__title {
    font-family: var(--head);
    font-weight: 600;
    font-size: 1.4rem;
    margin: 0 0 24px;
}

/* Data tables (About + Projects) */
.datatable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.datatable th,
.datatable td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.datatable th {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.datatable tbody tr:hover { background: rgba(232, 163, 61, 0.05); }

.datatable__title { font-weight: 500; }
.datatable__links a { margin-right: 12px; white-space: nowrap; }

.mono { font-family: var(--mono); font-size: 0.88rem; color: var(--text-muted); }

.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
}
.table-scroll .datatable { min-width: 640px; border: none; }

.empty-state { color: var(--text-muted); font-style: italic; }

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    border: 1px solid var(--line);
}

.skills-col {
    padding: 18px 20px;
    border-right: 1px solid var(--line);
}
.skills-col:last-child { border-right: none; }

.skills-col__title {
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    margin: 0 0 10px;
}

.skills-col__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.92rem;
    color: var(--text);
}

/* Contact */
.alert {
    background: rgba(232, 163, 61, 0.12);
    border: 1px solid var(--accent-dim);
    color: var(--text);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.contact-form {
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-row label {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.field-row input,
.field-row textarea {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.95rem;
    padding: 10px 12px;
    border-radius: 2px;
}
.field-row textarea { resize: vertical; }

.button {
    align-self: flex-start;
    background: var(--accent);
    color: #1A1206;
    border: none;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 11px 22px;
    border-radius: 2px;
    cursor: pointer;
}
.button:hover { background: #f0ae4d; }

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.footer {
    border-top: 1px solid var(--border);
    padding: 28px 24px 40px;
}

.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer__row {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}
.footer__row .val { color: var(--text); margin-left: 6px; }

.footer__links a {
    margin-left: 18px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.footer__links a:first-child { margin-left: 0; }
.footer__links a:hover { color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */
@media (max-width: 720px) {
    .record { grid-template-columns: repeat(2, 1fr); }
    .record__field:nth-child(2) { border-right: none; }

    .topbar__nav a { margin-left: 14px; font-size: 0.88rem; }

    .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .record { grid-template-columns: 1fr; }
    .record__field { border-right: none; border-bottom: 1px solid var(--border); }
    .record__field:last-child { border-bottom: none; }
}
