:root {
    color-scheme: dark;
    --bg: #070706;
    --ivory: #ece6d8;
    --ease: cubic-bezier(.16, 1, .3, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    background: var(--bg);
}

body {
    min-width: 320px;
    overflow: hidden;
    color: var(--ivory);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(196, 176, 138, 0.28);
    color: var(--ivory);
}

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

h1,
p {
    margin: 0;
}

.grain {
    position: fixed;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    opacity: 0.08;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.curtain {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: #0c0b0a;
    pointer-events: none;
    transform-origin: top;
    animation: lift 1.2s cubic-bezier(.76, 0, .24, 1) 0.05s forwards;
}

main {
    position: relative;
    height: 100dvh;
}

.portrait {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    animation: in 1.6s var(--ease) 0.35s forwards;
}

.portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 68% 20%;
    filter: contrast(1.06) saturate(0.8);
}

.portrait::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7, 7, 6, 0.82) 0%, rgba(7, 7, 6, 0.28) 34%, transparent 58%),
        linear-gradient(180deg, transparent 62%, rgba(7, 7, 6, 0.72) 100%);
    pointer-events: none;
}

.plate {
    position: absolute;
    z-index: 2;
    left: clamp(32px, 6vw, 90px);
    bottom: clamp(40px, 7.5vh, 85px);
    width: max-content;
    max-width: min(calc(100% - 40px), 960px);
}

h1 {
    overflow: hidden;
    font-size: clamp(44px, 7.2vw, 98px);
    font-weight: 400;
    font-style: italic;
    line-height: 1.02;
    letter-spacing: -0.025em;
    white-space: nowrap;
    cursor: default;
    color: var(--ivory);
    transition: text-shadow 0.6s var(--ease), transform 0.6s var(--ease);
}

h1:hover {
    text-shadow: 0 0 35px rgba(236, 230, 216, 0.3), 0 0 70px rgba(236, 230, 216, 0.1);
}

.anim {
    display: inline-flex;
}

.ch {
    display: inline-block;
    animation: rise 0.95s var(--ease) var(--d) both;
}

nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    margin-top: 20px;
    padding-top: 16px;
    position: relative;
}

nav::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(236, 230, 216, 0.2) 0%, rgba(236, 230, 216, 0.04) 65%, transparent 100%);
    transform-origin: left;
    animation: draw 0.9s var(--ease) 1.35s both;
}

nav a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: rgba(236, 230, 216, 0.52);
    font-size: clamp(11.5px, 1.05vw, 13px);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.22em;
    line-height: 1;
    text-transform: uppercase;
    padding: 6px 0;
    position: relative;
    cursor: pointer;
    transition:
        color 0.4s var(--ease),
        transform 0.4s var(--ease);
}

nav a > span {
    position: relative;
    display: inline-flex;
    padding-bottom: 3px;
    transition: letter-spacing 0.45s var(--ease), color 0.4s var(--ease);
}

/* Haute-couture filament underline */
nav a > span::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--ivory) 0%, rgba(236, 230, 216, 0.8) 70%, rgba(236, 230, 216, 0.3) 100%);
    box-shadow: 0 0 10px rgba(236, 230, 216, 0.35);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s var(--ease);
}

nav a:hover,
nav a:focus-visible {
    color: var(--ivory);
    transform: translateY(-1px);
}

nav a:hover > span,
nav a:focus-visible > span {
    letter-spacing: 0.26em;
    color: var(--ivory);
    text-shadow: 0 0 14px rgba(236, 230, 216, 0.35);
}

nav a:hover > span::after,
nav a:focus-visible > span::after {
    transform: scaleX(1);
}

nav a:active {
    transform: translateY(0);
}

.ig {
    margin-left: 22px;
    padding-left: 22px;
    border-left: 1px solid rgba(236, 230, 216, 0.14);
}

nav a:focus:not(:focus-visible) {
    outline: none;
}

nav a:focus-visible {
    outline: 1px solid rgba(236, 230, 216, 0.3);
    outline-offset: 4px;
}

nav svg {
    display: block;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    position: relative;
    top: -1.5px;
    animation: fadeUp 0.8s var(--ease) 1.55s forwards;
    transition: transform 0.4s var(--ease), filter 0.4s var(--ease), stroke 0.4s var(--ease);
}

.mail svg {
    width: 13.5px;
    height: 13.5px;
}

.ig svg {
    width: 12.5px;
    height: 12.5px;
    animation-delay: 1.85s;
}

nav a:hover svg,
nav a:focus-visible svg {
    transform: translateY(-2px);
    stroke: var(--ivory);
    filter: drop-shadow(0 0 5px rgba(236, 230, 216, 0.5));
}

@keyframes lift {
    to {
        transform: scaleY(0);
    }
}

@keyframes in {
    from {
        opacity: 0;
        transform: scale(1.06);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

@keyframes rise {
    from {
        transform: translateY(120%);
        opacity: 0;
    }
}

@keyframes draw {
    from {
        transform: scaleX(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 720px) {
    body {
        overflow: auto;
    }

    main {
        min-height: 100dvh;
        height: auto;
    }

    .portrait {
        position: relative;
        height: 100dvh;
    }

    .portrait img {
        object-position: 55% 18%;
    }

    .portrait::after {
        background: linear-gradient(180deg, transparent 38%, rgba(7, 7, 6, 0.92) 100%);
    }

    .plate {
        left: 20px;
        right: 20px;
        bottom: 32px;
        width: auto;
        max-width: none;
    }

    h1 {
        font-size: clamp(38px, 10.5vw, 58px);
        white-space: normal;
        line-height: 1.08;
    }

    nav {
        margin-top: 16px;
        padding-top: 14px;
    }

    nav a {
        font-size: 10.5px;
        letter-spacing: 0.2em;
        gap: 10px;
        padding: 4px 0;
    }

    .ig {
        margin-left: 16px;
        padding-left: 16px;
    }

    .mail svg {
        width: 12px;
        height: 12px;
    }

    .ig svg {
        width: 11px;
        height: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .curtain,
    .portrait,
    nav svg,
    .ch,
    nav::before {
        opacity: 1;
        transform: none;
        filter: none;
    }
}
