/*
 * Site styles. Component classes (ul-*) follow the Unleashed Lab design
 * system's bundle.css; layout classes below them are specific to this site.
 * Colors, spacing and radii come from tokens.css.
 */

/* Base */
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 26px;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { text-wrap: balance; }

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Buttons */
.ul-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); font: inherit; font-size: 15px; font-weight: 500; line-height: 20px; min-height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.ul-btn-primary { background: var(--accent); color: var(--on-accent); }
.ul-btn-primary:hover { filter: brightness(0.92); }
.ul-btn-secondary { background: var(--surface); color: var(--ink-strong); border-color: var(--border); }
.ul-btn-secondary:hover { border-color: var(--steel); }

/* Icons and illustrations */
.ul-icon { display: inline-block; flex-shrink: 0; vertical-align: -0.2em; }
.ul-illustration { display: block; max-width: 100%; height: auto; }

/* Theme toggle (System, Light, Dark) */
.ul-toggle { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg); }
.ul-toggle button { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; padding: 0 10px; font: inherit; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-muted); cursor: pointer; }
.ul-toggle button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }

/* Logo: show the light-mode or dark-mode file to match the theme */
.ul-logo { display: block; height: 28px; width: auto; }
.ul-logo-dark { display: none; }
:root[data-theme="dark"] .ul-logo-light { display: none; }
:root[data-theme="dark"] .ul-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .ul-logo-light { display: none; }
    :root:not([data-theme="light"]) .ul-logo-dark { display: block; }
}

/* Header */
.ul-header { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); }
.ul-header-bar { max-width: 1120px; margin: 0 auto; padding: 12px var(--space-4); display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.ul-header-home { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.ul-header-nav { display: flex; align-items: center; gap: var(--space-4); }
.ul-header-link { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; padding: 10px 0; border-bottom: 2px solid transparent; }
.ul-header-link:hover { color: var(--accent); }
.ul-header-link[aria-current="page"] { color: var(--ink-strong); border-bottom-color: var(--accent); }
/* Thin rule that sets site links (About) apart from the service links */
.ul-header-divider { width: 1px; height: 20px; background: var(--border); }
.ul-header-actions { display: flex; align-items: center; gap: var(--space-2); }
.ul-header-actions .ul-btn { min-height: 40px; }
.ul-header-menu { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink-strong); cursor: pointer; }

/* The full header row needs about 1000px (measured from the font metrics), so below 1040px the links fold into the menu button */
@media (max-width: 1040px) {
    .ul-header-menu { display: inline-flex; }
    .ul-header-divider { display: none; }
    .ul-header-nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: 0; padding-bottom: var(--space-3); }
    .ul-header-nav.is-open { display: flex; }
    .ul-header-link { width: 100%; padding: 12px 0; border-bottom: 1px solid var(--border); }
    .ul-header-actions { padding-top: var(--space-3); }
}

/* Footer */
.ul-footer { background: var(--bg); border-top: 1px solid var(--border); padding: var(--space-5) var(--space-4) var(--space-4); }
.ul-footer-top { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-5); }
.ul-footer-brand .ul-tagline { margin-top: var(--space-3); }
.ul-footer-title { margin: 0 0 var(--space-2); font-size: 14px; font-weight: 700; color: var(--ink-strong); }
.ul-footer-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ul-footer-group a { display: inline-block; padding: 6px 0; color: var(--ink); font-size: 14px; text-decoration: none; }
.ul-footer-group a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.ul-footer-note { max-width: 1120px; margin: var(--space-5) auto 0; padding-top: var(--space-3); border-top: 1px solid var(--border); font-size: 13px; color: var(--ink-muted); }

/* Tagline: words in ink-strong, periods in Reveal teal */
.ul-tagline { margin: 0; font-family: var(--font-sans); font-weight: 700; color: var(--ink-strong); letter-spacing: 0.01em; }
.ul-tagline-dot { color: var(--accent); }
.ul-tagline-sm { font-size: 16px; line-height: 22px; }

/* Layout */
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: var(--space-4); }
.h1 { margin: 0; font-size: clamp(32px, 5vw, 40px); line-height: 1.15; font-weight: 700; color: var(--ink-strong); }
.h3 { margin: 0; font-size: 21px; line-height: 27px; font-weight: 700; color: var(--ink-strong); }
.lede { margin: 0; font-size: 20px; line-height: 30px; color: var(--ink); max-width: 34em; }
.body { margin: 0; max-width: 68ch; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.actions-or { color: var(--ink-muted); }

/* Home splash: the tagline is the headline and always stays on one line */
.splash { padding-block: clamp(56px, 12vw, 128px) var(--space-6); }
.splash-copy { display: flex; flex-direction: column; gap: var(--space-4); }
.splash h1.ul-tagline { white-space: nowrap; font-size: min(52px, 4.4vw); line-height: 1.15; letter-spacing: -0.01em; }

/* Service tiles on the home page */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--border); }
.tile { grid-column: span 2; display: flex; flex-direction: column; gap: var(--space-2); text-decoration: none; color: inherit; border-radius: var(--radius-lg); align-items: center; text-align: center; }
/* Three across on a six-column grid. When the last row has two tiles, start it at column 2 so the pair sits centered */
.tile:nth-child(3n+1):nth-last-child(2) { grid-column: 2 / span 2; }
.tile .ul-illustration { width: 160px; }
.tile-name { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 18px; line-height: 24px; font-weight: 700; color: var(--ink-strong); }
/* Linked tiles carry an arrow. Left padding matches the arrow and its gap so the name itself, not name plus arrow, is centered under the illustration */
a.tile .tile-name { padding-left: calc(18px + var(--space-2)); }
.tile-name .ul-icon { color: var(--accent); transition: transform 0.15s; }
.tile p { margin: 0; max-width: 26ch; font-size: 15px; line-height: 22px; color: var(--ink-muted); }
a.tile:hover .tile-name { color: var(--accent); }
a.tile:hover .tile-name .ul-icon { transform: translateX(3px); }
.tile:focus-visible { outline-offset: 6px; }

/* Service pages: hero with illustration, then plain text sections */
.splash-sub { padding-block: var(--space-6); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: var(--space-5); align-items: center; }
.hero-ill { justify-self: center; }
.text-sections { margin-top: var(--space-6); }
.text-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-3) var(--space-5); padding-block: var(--space-5); border-top: 1px solid var(--border); }

/* About page: philosophy copy, then the founder with a square headshot */
.about-copy { display: flex; flex-direction: column; gap: var(--space-4); }
.founder { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
.founder-photo { aspect-ratio: 1; border-radius: var(--radius-lg); background: var(--surface-raised); overflow: hidden; display: grid; place-items: center; }
.founder-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-copy .body a { color: var(--accent); text-underline-offset: 3px; }
.about-copy .body a:hover { text-decoration-thickness: 2px; }
.founder-role { margin: 4px 0 0; color: var(--ink-muted); }

@media (max-width: 860px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr); }
    .hero-ill { justify-self: start; order: -1; }
    .hero-ill svg { width: 200px; }
}

@media (max-width: 760px) {
    .text-sections { margin-top: var(--space-5); }
    .text-section { grid-template-columns: minmax(0, 1fr); padding-block: var(--space-4); }
    .founder-photo { width: 160px; }
}

/* The tagline line is about 16.5em wide, so 5.2vw fits a 16px gutter down to 320px */
@media (max-width: 700px) {
    .splash h1.ul-tagline { font-size: 5.2vw; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tile, .tile:nth-child(3n+1):nth-last-child(2) { grid-column: auto; }
}

@media (max-width: 520px) {
    .wrap { padding-inline: var(--space-3); }
    .splash-sub { padding-block: var(--space-5); }
    .tiles { grid-template-columns: minmax(0, 1fr); margin-top: var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
    .tile-name .ul-icon { transition: none; }
}
