/* Fonts are served from this site and preloaded in each HTML file, so they
   arrive with the stylesheet instead of after a trip to Google.
   "block" keeps the wordmark from flashing in a fallback face first. */
@font-face {
    font-family: "BBH Hegarty";
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url("fonts/bbh-hegarty-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Staatliches";
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url("fonts/staatliches-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Only downloaded if the page uses one of these characters (Turkish letters, for example). */
@font-face {
    font-family: "Staatliches";
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url("fonts/staatliches-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --ink: #0a0a0a;
    --muted: #8c8c8c;
    --gutter: clamp(16px, 3vw, 40px);
    /* Wordmark: its font size, and how wide "TARHANSY" is per 1em of it. */
    --wordmark-size: 80px;
    --wordmark-em: 6.45;
    /* How far the hero image extends past each side of the wordmark. */
    --hero-pad: clamp(16px, 4vw, 48px);
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: var(--ink);
    font-family: "Staatliches", "Arial Narrow", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Hero: a centred column as wide as the wordmark plus --hero-pad on each side.
   On narrower screens it shrinks but always keeps --gutter of white on both sides.
   Same height on every page. */

.hero {
    position: relative;
    flex: none;
    align-self: center;
    width: min(100% - 2 * var(--gutter), calc(var(--wordmark-size) * var(--wordmark-em) + 2 * var(--hero-pad)));
    height: 54vh;
    height: 54svh;
    /* Whole pixels, so the wordmark's baseline and the hero's edge land on the same row. */
    height: round(54svh, 1px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    background: #111;
    container-type: inline-size;
}

.hero-slides img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    visibility: hidden;
}

.hero-slides img.is-active {
    visibility: visible;
}

/* Keeps the white wordmark readable on bright images. */
.hero::after {
    content: "";
    position: absolute;
    inset: 50% 0 0;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.45));
    pointer-events: none;
}

.wordmark {
    position: relative;
    z-index: 3;
    margin: 0;
    font-family: "BBH Hegarty", "Arial Black", sans-serif;
    font-weight: 400;
    /* Fixed size; only shrinks once the screen is too narrow to fit the word. */
    font-size: min(var(--wordmark-size), calc((100cqw - 2 * var(--hero-pad)) / var(--wordmark-em)));
    line-height: 1;
    /* Pulls the baseline down onto the hero's bottom edge, plus a hair more so
       rounding can only ever clip the letters, never leave a sliver of image under them. */
    margin-bottom: calc(-1em * var(--wordmark-drop) - 0.75px);
    white-space: nowrap;
    --wordmark-drop: 0.152;
}

/* Where supported, cut the line box at the baseline itself: exact in any font. */
@supports (text-box-trim: trim-end) {
    .wordmark {
        text-box-trim: trim-end;
        text-box-edge: cap alphabetic;
        margin-bottom: -0.75px;
    }
}

.wordmark a {
    color: #fff;
    text-decoration: none;
}

/* Links */

.links {
    padding: clamp(28px, 5svh, 52px) var(--gutter) 0;
}

.links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.links ul[hidden] {
    display: none;
}

.links li {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.links a,
.links button,
.links .empty {
    font-family: "Staatliches", "Arial Narrow", sans-serif;
    font-size: 22px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.links a,
.links button {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.links a:hover,
.links a:focus-visible,
.links button:hover,
.links button:focus-visible {
    border-bottom-color: var(--ink);
}

/* Collapsible group: looks like a link, with a plus beside it that becomes a
   minus when open. The icon hangs outside so the label stays centred. */
.links button {
    position: relative;
    margin: 0;
    padding: 0;
    border-width: 0 0 1px;
    border-radius: 0;
    background: none;
    cursor: pointer;
}

.links button::before,
.links button::after {
    content: "";
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    width: 11px;
    height: 2px;
    margin-top: -1px;
    background: currentColor;
    transition: transform 0.2s ease;
}

.links button::after {
    transform: rotate(90deg);
}

.links button[aria-expanded="true"]::after {
    transform: rotate(0deg);
}

/* Links inside an open group. */
.links ul ul {
    gap: 6px;
    padding: 8px 0 4px;
}

.links ul ul a {
    font-size: 18px;
}

.links .empty {
    color: var(--muted);
}

/* Sits at the bottom of the viewport when the links leave room. */
.contact {
    margin: auto 0 0;
    padding: clamp(16px, 2.5svh, 24px) var(--gutter) clamp(20px, 3svh, 32px);
    text-align: center;
    font-size: 15px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.contact a {
    color: var(--muted);
    text-decoration: none;
}

.contact a:hover,
.contact a:focus-visible {
    color: var(--ink);
}

/* "tarhansy" inside the email, set in the wordmark's face. Both faces have the
   same cap height, so at the same size the letters line up top and bottom. */
.contact .brand {
    font-family: "BBH Hegarty", "Arial Black", sans-serif;
    letter-spacing: 0.02em;
    margin: 0 0.12em;
}
