:root {
    --font-display: 'Bricolage Grotesque', Georgia, serif;
    --font-sans: 'Figtree', system-ui, -apple-system, sans-serif;

    --bg: #f3f6f8;
    --bg-elevated: #ffffff;
    --bg-soft: #e8eef2;

    --ink: #102033;
    --ink-soft: #3d4f63;
    --ink-muted: #6b7c8f;

    --accent: #0e7c74;
    --accent-deep: #0a5c56;
    --accent-bright: #12a396;
    --accent-soft: rgba(14, 124, 116, 0.1);
    --accent-line: rgba(14, 124, 116, 0.22);

    --cemido: #1a6fd4;
    --scriptorium: #0e7c74;

    --border: rgba(16, 32, 51, 0.08);
    --border-strong: rgba(16, 32, 51, 0.14);

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;

    --shadow-soft: 0 10px 30px rgba(16, 32, 51, 0.06);
    --shadow-lift: 0 18px 40px rgba(16, 32, 51, 0.1);

    --container: 1120px;
    --header-height: 76px;
    --transition: 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-soft);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Atmosphere ── */

.bg-stage {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 55% at 50% -10%, #ffffff 0%, transparent 55%),
        linear-gradient(180deg, #f7fbfc 0%, #f2f7f9 42%, #eaf2f5 100%);
}

.bg-wash {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.85;
    animation: drift 22s ease-in-out infinite;
    will-change: transform;
}

.bg-wash--a {
    width: 52vw;
    height: 52vw;
    max-width: 720px;
    max-height: 720px;
    top: -12%;
    right: -8%;
    background: radial-gradient(circle, rgba(18, 163, 150, 0.38) 0%, transparent 70%);
}

.bg-wash--b {
    width: 44vw;
    height: 44vw;
    max-width: 560px;
    max-height: 560px;
    top: 18%;
    left: -12%;
    background: radial-gradient(circle, rgba(26, 111, 212, 0.22) 0%, transparent 70%);
    animation-delay: -8s;
}

.bg-wash--c {
    width: 40vw;
    height: 40vw;
    max-width: 480px;
    max-height: 480px;
    bottom: 5%;
    right: 18%;
    background: radial-gradient(circle, rgba(16, 32, 51, 0.06) 0%, transparent 70%);
    animation-delay: -14s;
}

.bg-grain {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px;
    pointer-events: none;
}

.bg-ring {
    position: absolute;
    top: 8%;
    left: 50%;
    width: min(920px, 92vw);
    height: min(920px, 92vw);
    transform: translateX(-50%);
    border: 1px solid rgba(16, 32, 51, 0.05);
    border-radius: 50%;
    mask-image: linear-gradient(180deg, black 0%, transparent 72%);
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(24px, -18px) scale(1.06); }
    70% { transform: translate(-16px, 14px) scale(0.96); }
}

/* ── Header ── */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    transition: background var(--transition), border-color var(--transition), backdrop-filter var(--transition), box-shadow var(--transition);
}

.header--scrolled {
    background: rgba(243, 246, 248, 0.82);
    backdrop-filter: blur(18px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(16, 32, 51, 0.04);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--ink);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 13px;
    color: #fff;
    letter-spacing: -0.02em;
}

.logo__mark--sm {
    width: 32px;
    height: 32px;
    font-size: 11px;
}

.logo__text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--ink);
    letter-spacing: -0.03em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav__link {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.nav__link:hover {
    color: var(--ink);
    background: rgba(16, 32, 51, 0.04);
}

/* ── Hero ── */

.hero {
    position: relative;
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: calc(var(--header-height) + 48px) 0 80px;
    overflow: clip;
}

.hero__inner {
    position: relative;
    z-index: 2;
    max-width: 560px;
}

.hero__brand {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 12vw, 7.5rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.06em;
    color: var(--ink);
    margin-bottom: 28px;
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.8vw, 3.35rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.035em;
    color: var(--ink);
    margin-bottom: 20px;
}

.hero__title em {
    font-style: normal;
    color: var(--accent);
    background: linear-gradient(120deg, var(--accent) 0%, #1a6fd4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero__subtitle {
    font-size: clamp(1.05rem, 2vw, 1.15rem);
    color: var(--ink-soft);
    max-width: 560px;
    margin-bottom: 36px;
    line-height: 1.75;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.btn--primary {
    color: #fff;
    background: var(--ink);
    box-shadow: 0 12px 28px rgba(16, 32, 51, 0.18);
}

.btn--primary:hover {
    background: var(--accent-deep);
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(10, 92, 86, 0.22);
}

.btn--ghost {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(8px);
}

.btn--ghost:hover {
    background: #fff;
    border-color: var(--accent-line);
    transform: translateY(-2px);
}

.btn__icon {
    width: 18px;
    height: 18px;
    transition: transform var(--transition);
}

.btn--primary:hover .btn__icon {
    transform: translateX(3px);
}

.hero__visual {
    position: absolute;
    inset: var(--header-height) 0 0;
    z-index: 1;
    pointer-events: none;
}

.hero__orbit {
    position: absolute;
    border: 1px solid rgba(16, 32, 51, 0.08);
    border-radius: 50%;
    right: 4%;
    top: 14%;
    animation: spin 48s linear infinite;
}

.hero__orbit--1 {
    width: min(520px, 42vw);
    height: min(520px, 42vw);
}

.hero__orbit--2 {
    width: min(360px, 30vw);
    height: min(360px, 30vw);
    top: calc(14% + min(80px, 6vw));
    right: calc(4% + min(80px, 6vw));
    animation-duration: 36s;
    animation-direction: reverse;
    border-color: rgba(14, 124, 116, 0.18);
}

.hero__orbit--3 {
    width: min(210px, 18vw);
    height: min(210px, 18vw);
    top: calc(14% + min(155px, 12vw));
    right: calc(4% + min(155px, 12vw));
    animation-duration: 24s;
    border-color: rgba(26, 111, 212, 0.2);
}

.hero__orbit::before {
    content: '';
    position: absolute;
    top: 8%;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    border-radius: 50%;
    background: var(--accent);
}

.hero__orbit--3::before {
    background: var(--cemido);
    width: 8px;
    height: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hero__panel {
    position: absolute;
    right: 8%;
    top: 26%;
    width: min(260px, 22vw);
    height: min(320px, 34vw);
    padding: 28px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: float-panel 7s ease-in-out infinite;
}

.hero__panel-line {
    display: block;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(16, 32, 51, 0.08), rgba(16, 32, 51, 0.03));
}

.hero__panel-line:nth-child(1) { width: 72%; }
.hero__panel-line:nth-child(2) { width: 100%; }
.hero__panel-line:nth-child(3) { width: 54%; }

.hero__panel-dot {
    margin-top: auto;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent) 0%, #1a6fd4 100%);
    animation: pulse-soft 2.8s ease-in-out infinite;
}

@keyframes float-panel {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

@keyframes pulse-soft {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.06); opacity: 0.88; }
}

/* ── Section header ── */

.section-header {
    text-align: left;
    margin-bottom: 40px;
    max-width: 560px;
}

.section-header__eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-bottom: 14px;
}

.section-header__title {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4vw, 2.75rem);
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.section-header__desc {
    font-size: 1.05rem;
    color: var(--ink-soft);
}

/* ── Projects ── */

.projects {
    padding: 40px 0 100px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    padding: 28px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    transform-style: preserve-3d;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), var(--card-accent-soft), transparent 42%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lift);
}

.project-card:hover::before {
    opacity: 1;
}

.project-card__glow {
    display: none;
}

.project-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
}

.project-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--card-accent-soft);
    border-radius: var(--radius);
    color: var(--card-accent);
    transition: transform var(--transition);
}

.project-card:hover .project-card__icon {
    transform: scale(1.06) rotate(-3deg);
}

.project-card__icon svg {
    width: 24px;
    height: 24px;
}

.project-card__status {
    padding: 5px 11px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 8px;
}

.project-card__status--live {
    color: #0a7a5c;
    background: rgba(10, 122, 92, 0.1);
    border: 1px solid rgba(10, 122, 92, 0.18);
}

.project-card__status--soon {
    color: #9a6700;
    background: rgba(154, 103, 0, 0.1);
    border: 1px solid rgba(154, 103, 0, 0.18);
}

.project-card__body {
    flex: 1;
    margin-bottom: 28px;
}

.project-card__tagline {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--card-accent);
    margin-bottom: 10px;
}

.project-card__name {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.project-card__desc {
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink-soft);
}

.project-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-card__tag {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-muted);
    background: var(--bg-soft);
    border-radius: 6px;
}

.project-card__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #fff;
    background: var(--ink);
    border-radius: 12px;
    flex-shrink: 0;
    transition: background var(--transition), transform var(--transition);
}

.project-card__arrow svg {
    width: 18px;
    height: 18px;
}

.project-card:hover .project-card__arrow {
    background: var(--card-accent);
    transform: translateX(3px);
}

.project-card--soon {
    cursor: default;
    background: linear-gradient(180deg, #ffffff 0%, #f7fafb 100%);
    border-style: dashed;
}

.project-card--soon:hover {
    transform: none;
    box-shadow: var(--shadow-soft);
}

.project-card--soon .project-card__name {
    color: var(--ink);
}

.project-card__soon-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-muted);
    white-space: nowrap;
}

/* ── About ── */

.about {
    padding: 40px 0 120px;
}

.about__inner {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    align-items: start;
    padding: 40px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius-lg) + 4px);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
}

.about__title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 14px 0 18px;
}

.about__text {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--ink-soft);
    margin-bottom: 32px;
}

.about__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.about__meta-item {
    padding-top: 16px;
    border-top: 2px solid var(--accent-line);
}

.about__meta-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.about__meta-label {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.about__features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feature {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 16px;
    padding: 18px;
    border-radius: var(--radius);
    transition: background var(--transition);
}

.feature:hover {
    background: rgba(14, 124, 116, 0.05);
}

.feature__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
}

.feature__icon svg {
    width: 20px;
    height: 20px;
}

.feature__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}

.feature__desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-soft);
}

/* ── Footer ── */

.footer {
    padding: 28px 0 36px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.4);
}

.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer__copy {
    font-size: 13px;
    color: var(--ink-muted);
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
}

.footer__link {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-muted);
    transition: color var(--transition);
}

.footer__link:hover {
    color: var(--accent);
}

/* ── Legal pages ── */

.legal {
    padding: calc(var(--header-height) + 48px) 0 80px;
}

.legal__inner {
    max-width: 760px;
    padding: 40px 32px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius-lg) + 4px);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.legal__eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-bottom: 14px;
}

.legal__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.legal__lead {
    font-size: 1.05rem;
    color: var(--ink-soft);
    margin-bottom: 40px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.legal__section {
    margin-bottom: 32px;
}

.legal__section h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.legal__section p,
.legal__section li {
    font-size: 0.98rem;
    line-height: 1.75;
    color: var(--ink-soft);
}

.legal__section p + p {
    margin-top: 12px;
}

.legal__section ul {
    margin: 12px 0 0 1.2em;
}

.legal__section li + li {
    margin-top: 6px;
}

.legal__section a {
    color: var(--accent-deep);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.legal__section a:hover {
    color: var(--accent);
}

.legal__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-muted);
}

.legal__nav a {
    color: var(--ink);
    transition: color var(--transition);
}

.legal__nav a:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .legal__inner {
        padding: 28px 20px;
    }
}

/* ── Reveal ── */

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 0.08s; }
.reveal--delay-2 { transition-delay: 0.16s; }
.reveal--delay-3 { transition-delay: 0.24s; }
.reveal--delay-4 { transition-delay: 0.32s; }

/* ── Responsive ── */

@media (max-width: 900px) {
    .hero__panel,
    .hero__orbit {
        opacity: 0.35;
    }

    .hero__panel {
        display: none;
    }

    .project-grid,
    .about__inner {
        grid-template-columns: 1fr;
    }

    .about__inner {
        padding: 28px 22px;
        gap: 36px;
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding-top: calc(var(--header-height) + 40px);
        padding-bottom: 64px;
    }

    .hero__brand {
        margin-bottom: 18px;
    }

    .nav {
        gap: 2px;
    }

    .nav__link {
        padding: 8px 10px;
        font-size: 13px;
    }

    .about__meta {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .footer__inner {
        flex-direction: column;
        text-align: center;
    }

    .footer__brand {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
