/* ============================================================
   Ellery Faller — whitewashed index
   Light, airy, gallery-wall aesthetic. One centered list.
   ============================================================ */

:root {
    --wall: #f6f4ef;
    --wall-deep: #eeebe4;
    --ink: #26241f;
    --ink-soft: #6f6a5f;
    --ink-faint: #a9a498;
    --hair: #e2ddd2;
    --hair-strong: #c9c3b5;
    --forest: #1f4330;
    --forest-hover: #2b5c40;
    --forest-soft: #4f6f5c;
    --forest-hair: rgba(31, 67, 48, 0.5);
    --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--sans);
    color: var(--ink);
    line-height: 1.6;
    min-height: 100svh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* whitewashed wall: faint daylight from the top, slightly deeper at the edges */
    background:
        radial-gradient(120% 90% at 50% 0%, #fbfaf7 0%, rgba(251, 250, 247, 0) 55%),
        radial-gradient(140% 120% at 50% 115%, var(--wall-deep) 0%, rgba(238, 235, 228, 0) 55%),
        var(--wall);
}

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

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    text-align: inherit;
}

/* ===== Plaster grain ===== */
.grain {
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 60;
    opacity: 0.065;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Terrain contour canvas ===== */
.topo {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== Header / footer — barely there ===== */
.site-head {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: clamp(1.25rem, 3vw, 2rem) clamp(1.5rem, 4vw, 2.75rem);
    animation: fade-in 1.2s var(--ease-out) 0.1s both;
}

.wordmark {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--forest);
    transition: color 0.3s ease;
}

.wordmark:hover {
    color: var(--forest-hover);
}

.site-foot {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: clamp(1.25rem, 3vw, 2rem) clamp(1.5rem, 4vw, 2.75rem);
    display: flex;
    justify-content: center;
    font-size: 0.625rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-faint);
    animation: fade-in 1.2s var(--ease-out) 0.6s both;
}

/* ===== Index — the centered list ===== */
.index {
    position: relative;
    z-index: 2;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 5rem clamp(1.5rem, 6vw, 4rem);
}

.link-list {
    width: min(620px, 100%);
}

.row {
    position: relative;
    display: grid;
    grid-template-columns: 2.75rem 1fr auto;
    align-items: baseline;
    column-gap: clamp(0.5rem, 2vw, 1.25rem);
    width: 100%;
    padding: clamp(0.85rem, 2.4vh, 1.35rem) 0;
    cursor: pointer;
    /* entrance */
    opacity: 0;
    transform: translateY(28px);
    animation: rise 0.9s var(--ease-out) forwards;
    animation-delay: calc(0.35s + 0.12s * var(--i));
}

/* hairline under each row, draws itself in */
.row::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--hair);
    transform: scaleX(0);
    transform-origin: left center;
    animation: draw 1.1s var(--ease-out) forwards;
    animation-delay: calc(0.45s + 0.12s * var(--i));
    transition: background 0.35s ease, height 0.35s ease;
}

.row:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: var(--hair);
    transform: scaleX(0);
    transform-origin: left center;
    animation: draw 1.1s var(--ease-out) forwards;
    animation-delay: 0.45s;
}

.num {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    color: var(--ink-faint);
    transform: translateY(-0.35em);
    transition: color 0.3s ease;
}

.label {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 2.4vw + 1.55rem, 3.1rem);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.01em;
    color: var(--ink);
    transition: transform 0.5s var(--ease-out), color 0.35s ease;
}

.arrow {
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 300;
    color: var(--ink-soft);
    opacity: 0;
    transform: translateX(-10px) translateY(-0.35em);
    transition: opacity 0.35s ease, transform 0.5s var(--ease-out);
}

/* hover / focus */
.row:hover .label,
.row:focus-visible .label {
    transform: translateX(12px);
    color: var(--forest);
}

.row:hover .arrow,
.row:focus-visible .arrow {
    opacity: 1;
    transform: translateX(0) translateY(-0.35em);
    color: var(--forest);
}

.row:hover .num,
.row:focus-visible .num {
    color: var(--forest-soft);
}

.row:hover::after,
.row:focus-visible::after {
    background: var(--forest-hair);
}

.row:focus-visible {
    outline: none;
}

.row:focus-visible .label {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    text-decoration-color: var(--hair-strong);
}

.row:active .label {
    transform: translateX(12px) scale(0.99);
}

/* ===== Project rows — hover reveals a line or two ===== */
.label .desc {
    display: block;
    max-width: 44ch;
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    font-family: var(--sans);
    font-size: 0.8125rem;
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 0;
    color: var(--ink-soft);
    transition: max-height 0.55s var(--ease-out), opacity 0.45s ease,
                transform 0.55s var(--ease-out), margin-top 0.55s var(--ease-out);
}

.row:hover .desc,
.row:focus-visible .desc {
    max-height: 5rem;
    margin-top: 0.5rem;
    opacity: 1;
    transform: translateY(0);
}

/* ===== "Building" — the empty one ===== */
.row--button .label {
    color: var(--ink-soft);
}

.row--button:hover .label,
.row--button:focus-visible .label {
    color: var(--forest);
}

/* per-letter hop */
.label .ch {
    display: inline-block;
    will-change: transform;
}

.label .ch.hop {
    animation: hop 0.55s var(--ease-out) both;
}

/* the little "soon" note */
.soon {
    position: absolute;
    left: 50%;
    bottom: clamp(4.5rem, 12vh, 7rem);
    transform: translateX(-50%) translateY(8px);
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: var(--forest-soft);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.soon.show {
    animation: soon-fade 2.8s ease forwards;
}

/* ===== About page ===== */
.about {
    position: relative;
    z-index: 2;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 6rem clamp(1.5rem, 6vw, 4rem);
}

.about-inner {
    width: min(560px, 100%);
}

.about-title {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
    opacity: 0;
    transform: translateY(24px);
    animation: rise 0.9s var(--ease-out) forwards;
    animation-delay: calc(0.25s + 0.12s * var(--i));
}

.about-lede {
    font-family: var(--serif);
    font-size: clamp(1.25rem, 2.2vw, 1.55rem);
    font-weight: 500;
    line-height: 1.45;
    color: var(--ink);
    margin-bottom: 1.25rem;
    opacity: 0;
    transform: translateY(24px);
    animation: rise 0.9s var(--ease-out) forwards;
    animation-delay: calc(0.25s + 0.12s * var(--i));
}

.about-body {
    font-size: 0.9375rem;
    font-weight: 300;
    line-height: 1.85;
    color: var(--ink-soft);
    max-width: 46ch;
    margin-bottom: clamp(2.25rem, 6vh, 3.5rem);
    opacity: 0;
    transform: translateY(24px);
    animation: rise 0.9s var(--ease-out) forwards;
    animation-delay: calc(0.25s + 0.12s * var(--i));
}

.back-link {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-soft);
    padding-bottom: 0.35em;
    border-bottom: 1px solid var(--hair);
    transition: color 0.3s ease, border-color 0.3s ease;
    opacity: 0;
    transform: translateY(24px);
    animation: rise 0.9s var(--ease-out) forwards;
    animation-delay: calc(0.25s + 0.12s * var(--i));
}

.back-link:hover {
    color: var(--forest);
    border-color: var(--forest-hair);
}

/* ===== About logo row ===== */
.logo-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(1.5rem, 4.5vw, 2.75rem);
    margin-bottom: clamp(2.25rem, 6vh, 3.5rem);
    opacity: 0;
    transform: translateY(24px);
    animation: rise 0.9s var(--ease-out) forwards;
    animation-delay: calc(0.25s + 0.12s * var(--i));
}

.logo-row img {
    height: clamp(1.4rem, 2.6vw, 1.9rem);
    width: auto;
    display: block;
    filter: grayscale(1);
    opacity: 0.5;
    transition: filter 0.45s ease, opacity 0.45s ease, transform 0.45s var(--ease-out);
}

.logo-row img:hover {
    filter: grayscale(0);
    opacity: 1;
    transform: translateY(-2px);
}

/* ===== Keyframes ===== */
@keyframes rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes draw {
    to {
        transform: scaleX(1);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes hop {
    0% {
        transform: translateY(0);
    }
    35% {
        transform: translateY(-0.22em) rotate(-2deg);
    }
    65% {
        transform: translateY(0.04em);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes soon-fade {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(8px);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    72% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-6px);
    }
}

/* ===== Small screens ===== */
@media (max-width: 560px) {
    .row {
        grid-template-columns: 2.1rem 1fr auto;
    }

    .num {
        letter-spacing: 0.16em;
    }

    .row:hover .label {
        transform: none;
    }

    /* touch: show the arrow always, keep the row itself the feedback */
    .arrow {
        opacity: 0.55;
        transform: translateY(-0.35em);
    }

    .row:active {
        opacity: 0.65;
    }
}

/* touch devices have no hover — descriptions stay visible */
@media (hover: none) {
    .label .desc {
        max-height: none;
        margin-top: 0.45rem;
        opacity: 0.85;
        transform: none;
    }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .row,
    .about-title,
    .about-lede,
    .about-body,
    .logo-row,
    .back-link {
        opacity: 1;
        transform: none;
    }

    .row::after,
    .row:first-child::before {
        transform: scaleX(1);
    }
}
