/* ---- Front page: by day, by night ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0b0b0c;
    --surface: #141416;
    --border: #232326;
    --text: #f2f2f3;
    --muted: #8c8c92;
    --faint: #5a5a60;
    --night-accent: #5a9bf0;

    --day-bg: #f4f1ea;
    --day-text: #1f1c17;
    --day-muted: #6e665a;
    --day-faint: #a39a8a;
    --day-border: #e2dccf;
    --day-accent: #b4622d;

    --gutter: 1.5rem;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

a {
    color: inherit;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: 0.5rem 1rem;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ---- Intro ---- */
.intro {
    padding-top: 6rem;
    padding-bottom: 4rem;
}

.intro h1 {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.tagline {
    font-size: clamp(1.25rem, 2.6vw, 1.625rem);
    color: var(--muted);
    line-height: 1.35;
    margin-top: 1.25rem;
    max-width: 640px;
    text-wrap: balance;
}

.tagline em {
    font-style: normal;
    color: var(--text);
}

.meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    margin-top: 2rem;
    font-size: 0.875rem;
}

.location {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--muted);
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
    transition: border-color 200ms ease, background-color 200ms ease;
}

.links a:hover {
    border-color: #3a3a3f;
    background: var(--surface);
}

.meta svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ---- Day and night ---- */
.sides {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    padding-bottom: 5rem;
}

.side {
    border-radius: 1.75rem;
    padding: 2.5rem;
}

.side-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.side-label svg {
    width: 16px;
    height: 16px;
}

.side h2 {
    font-size: clamp(1.875rem, 3.4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.08;
    margin-top: 0.875rem;
    text-wrap: balance;
}

.side-lead {
    margin-top: 1rem;
    font-size: 1.0625rem;
    line-height: 1.55;
}

/* By day */
.day {
    background: var(--day-bg);
    color: var(--day-text);
}

.day .side-label {
    color: var(--day-accent);
}

.day .side-lead {
    color: var(--day-muted);
}

.timeline {
    list-style: none;
    margin-top: 2.25rem;
    position: relative;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 1px;
    background: var(--day-border);
}

.role {
    position: relative;
    padding-left: 1.75rem;
    padding-bottom: 1.5rem;
}

.role:last-child {
    padding-bottom: 0;
}

.role::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.4rem;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--day-bg);
    border: 2px solid var(--day-faint);
}

.role--now::before {
    background: var(--day-accent);
    border-color: var(--day-accent);
    box-shadow: 0 0 0 4px rgba(180, 98, 45, 0.18);
}

.role-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.625rem;
}

.role-head h3 {
    font-size: 1.0625rem;
    font-weight: 600;
}

.role-head a {
    text-decoration: none;
}

.role-head a:hover {
    text-decoration: underline;
}

.when {
    font-size: 0.8125rem;
    color: var(--day-faint);
    font-variant-numeric: tabular-nums;
}

.now {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--day-accent);
    background: rgba(180, 98, 45, 0.12);
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
}

.role p {
    color: var(--day-muted);
    font-size: 0.9375rem;
    margin-top: 0.25rem;
}

.role--school h3 {
    font-weight: 500;
}

/* By night */
.night {
    background: #000;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.night::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1.5px 1.5px at 12% 18%, #fff8, transparent),
        radial-gradient(1px 1px at 78% 12%, #fff6, transparent),
        radial-gradient(1.5px 1.5px at 64% 32%, #fff5, transparent),
        radial-gradient(1px 1px at 90% 48%, #fff6, transparent),
        radial-gradient(1px 1px at 28% 8%, #fff5, transparent),
        radial-gradient(60% 40% at 80% 0%, rgba(90, 155, 240, 0.16), transparent 70%);
    pointer-events: none;
}

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

.night > * {
    position: relative;
}

.night .apps {
    align-self: stretch;
}

.night-note {
    margin-top: auto;
    padding-top: 2rem;
    color: var(--faint);
    font-size: 0.875rem;
}

.night .side-label {
    color: var(--night-accent);
}

.night .side-lead {
    color: var(--muted);
}

.apps {
    display: grid;
    gap: 0.75rem;
    margin-top: 2.25rem;
}

.app {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1.125rem;
    border-radius: 1.25rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 250ms ease, border-color 250ms ease;
}

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

.app-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.app-icon img {
    width: 100%;
    height: 100%;
    display: block;
}

.app h3 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.app p {
    font-size: 0.875rem;
    margin-top: 0.125rem;
}

.app-arrow {
    width: 18px;
    height: 18px;
    opacity: 0.5;
    transition: opacity 250ms ease, transform 250ms ease;
}

.app:hover .app-arrow {
    opacity: 1;
    transform: translateX(3px);
}

.app-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.app-tags span {
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
}

/* Echo: black and blue, like its page */
.app--echo {
    background: #0a0a0b;
    border-color: #1d1d1f;
}

.app--echo:hover {
    border-color: #2f7de1;
}

.app--echo .app-icon {
    background: #000;
    border: 1px solid #2a2a2c;
}

.app--echo p {
    color: #86868b;
}

.app--echo .app-tags span {
    background: #1c1c1e;
    color: #c7c7cc;
}

.wave {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 22px;
}

.wave i {
    display: block;
    width: 4px;
    height: 100%;
    border-radius: 999px;
    background: #5a9bf0;
}

.wave i:nth-child(1) { transform: scaleY(0.35); }
.wave i:nth-child(2) { transform: scaleY(0.7); }
.wave i:nth-child(3) { transform: scaleY(1); }
.wave i:nth-child(4) { transform: scaleY(0.62); }
.wave i:nth-child(5) { transform: scaleY(0.3); }

.app--echo:hover .wave i {
    animation: wave 1.2s ease-in-out infinite;
}

.app--echo:hover .wave i:nth-child(2) { animation-delay: -0.2s; }
.app--echo:hover .wave i:nth-child(3) { animation-delay: -0.45s; }
.app--echo:hover .wave i:nth-child(4) { animation-delay: -0.7s; }
.app--echo:hover .wave i:nth-child(5) { animation-delay: -0.9s; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

/* Nasheet: night navy and purple, like its page */
.app--nasheet {
    background: #0d0e1f;
    border-color: #2a2d55;
}

.app--nasheet:hover {
    border-color: #667eea;
}

.app--nasheet p {
    color: #a6a8c8;
}

.app--nasheet .app-tags span {
    background: #1d1f3a;
    color: #c9ccff;
}

/* RailsDuels */
.app--duels {
    background: #140c0c;
    border-color: #2e1a1a;
}

.app--duels:hover {
    border-color: #cc3b3b;
}

.app--duels .app-icon {
    background: linear-gradient(135deg, #e5484d, #8f1d22);
    color: #fff;
}

.app--duels .app-icon svg {
    width: 26px;
    height: 26px;
}

.app--duels p {
    color: #b59a9a;
}

.app--duels .app-tags span {
    background: #2a1616;
    color: #f2c4c4;
}

footer {
    border-top: 1px solid #18181b;
    padding: 2rem 0;
    color: var(--faint);
    font-size: 0.8125rem;
    text-align: center;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .sides {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    :root {
        --gutter: 1rem;
    }

    .intro {
        padding-top: 4rem;
        padding-bottom: 3rem;
    }

    .side {
        padding: 1.75rem 1.375rem;
        border-radius: 1.375rem;
    }

    .app {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 0.875rem;
        padding: 1rem;
    }

    .app-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .app-arrow {
        display: none;
    }
}

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

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
