/*
 * ═══════════════════════════════════════════════════════════
 *  DESIGN SYSTEM — herbasz.uk
 * ═══════════════════════════════════════════════════════════
 *
 *  Philosophy
 *  ----------
 *  Minimal, confident, Apple-inspired. No gradients, shadows,
 *  or decorative elements. Let typography and whitespace do
 *  the work. Every interaction should feel physical and precise.
 *
 *
 *  Typography
 *  ----------
 *  Display / Headings:  DM Serif Display, Georgia, serif
 *                       weight 400 only, letter-spacing -0.02em
 *  Body / UI:           DM Sans, -apple-system, sans-serif
 *                       weights 400 (body), 500 (labels/buttons), italic
 *  Base size:           16px (1rem)
 *  Body line-height:    1.75 (prose), 1.05 (display headings)
 *  Reading width:       720px max (single column prose)
 *
 *
 *  Colour Palette
 *  --------------
 *  Light mode:
 *    --bg:              #fafafa    (off-white background)
 *    --fg:              #111111    (near-black text)
 *    --fg-muted:        #888888    (secondary text, labels)
 *    --fg-placeholder:  #bbbbbb    (input placeholders)
 *    --border:          rgba(0,0,0,0.15)
 *    --border-focus:    rgba(0,0,0,0.4)
 *    --surface:         rgba(0,0,0,0.03)   (input backgrounds)
 *    --icon-bg/fg:      inverted (#111 / #fafafa)
 *
 *  Dark mode:
 *    --bg:              #111111
 *    --fg:              #f0f0f0
 *    --fg-muted:        #777777
 *    --fg-placeholder:  #555555
 *    --border:          rgba(255,255,255,0.18)
 *    --border-focus:    rgba(255,255,255,0.45)
 *    --surface:         rgba(255,255,255,0.04)
 *    --icon-bg/fg:      inverted (#f0f0f0 / #111)
 *
 *
 *  Spacing Scale
 *  -------------
 *  0.25rem   tiny (greeting margin)
 *  0.5rem    toolbar gaps, small internal padding
 *  0.75rem   icon gaps, input padding
 *  1.25rem   nav padding, paragraph spacing
 *  1.5rem    form group spacing, grid gaps
 *  2rem      section dividers, heading margins
 *  2.5rem    page horizontal padding (desktop)
 *  3-4rem    page vertical padding (desktop)
 *  7rem      page top padding (accounts for fixed nav)
 *
 *  Mobile adjustments: reduce by ~30-40%
 *
 *
 *  Animations
 *  ----------
 *  Easing:    cubic-bezier(0.25, 0.1, 0.25, 1)  — standard (subtle)
 *             cubic-bezier(0.16, 1, 0.3, 1)      — reveal (fast start, soft land)
 *  Duration:  0.6–0.9s for entrance animations
 *  Stagger:   0.1–0.15s between sequential elements
 *  Patterns:
 *    fadeInSubtle  — opacity 0→1 + translateY(8px→0)
 *    revealUp      — translateY(105%→0) behind overflow:hidden mask
 *    expandWidth   — width 0→48px (divider)
 *    fadeIn         — opacity only
 *  Always respect prefers-reduced-motion.
 *
 *
 *  Interactions
 *  ------------
 *  Hover:   scale(1.08–1.1) or translateY(-4px)
 *  Active:  scale(0.95–0.98)
 *  Transitions: 0.2–0.3s for interactions, 0.5s for theme changes
 *
 *
 *  Layout
 *  ------
 *  Max content width:  1100px (hero, adventures grid, about)
 *  Reading width:      720px (single adventure, about text)
 *  Grid columns:       2-col (desktop) → 1-col (mobile at 680px)
 *  Nav:                fixed top, background: var(--bg)
 *  Border radius:      4px (inputs, buttons), 50% (icons, toggle)
 *
 *
 *  Breakpoints
 *  -----------
 *  Desktop:     > 960px
 *  Tablet:      680–960px
 *  Mobile:      < 680px
 *  Small:       < 380px
 *
 * ═══════════════════════════════════════════════════════════
 */

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

/* ── Theme Variables ── */
:root {
    --bg: #fafafa;
    --fg: #111111;
    --fg-muted: #888888;
    --fg-placeholder: #bbbbbb;
    --border: rgba(0,0,0,0.15);
    --border-focus: rgba(0,0,0,0.4);
    --icon-bg: #111111;
    --icon-fg: #fafafa;
    --toggle-border: rgba(0,0,0,0.12);
    --surface: rgba(0,0,0,0.03);
}

.dark {
    --bg: #111111;
    --fg: #f0f0f0;
    --fg-muted: #777777;
    --fg-placeholder: #555555;
    --border: rgba(255,255,255,0.18);
    --border-focus: rgba(255,255,255,0.45);
    --icon-bg: #f0f0f0;
    --icon-fg: #111111;
    --toggle-border: rgba(255,255,255,0.12);
    --surface: rgba(255,255,255,0.04);
}

/* ── Base ── */
html { font-size: 16px; }

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--fg);
    transition: background-color 0.5s ease, color 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Skip Link (accessibility) ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    padding: 0.5rem 1rem;
    background: var(--fg);
    color: var(--bg);
    font-size: 0.85rem;
    border-radius: 4px;
    z-index: 200;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0.75rem;
}

/* ── Focus Styles ── */
*:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 2px;
}

button:focus-visible,
.theme-toggle:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 2px;
}

/* ── Navigation ── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2.5rem;
    background: var(--bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.5s ease, background-color 0.5s ease;
}

.nav--bordered {
    /* no border — clean like the homepage */
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--fg-muted);
    text-decoration: none;
    transition: color 0.3s;
    letter-spacing: 0.01em;
}

.nav-link:hover,
.nav-link--active {
    color: var(--fg);
}

/* ── Theme Toggle ── */
.theme-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--toggle-border);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-muted);
    transition: color 0.3s, border-color 0.3s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { color: var(--fg); transform: scale(1.08); }
.theme-toggle:active { transform: scale(0.95); }
.theme-toggle svg { width: 16px; height: 16px; transition: opacity 0.3s, transform 0.4s; }
.theme-toggle .sun { display: none; }
.dark .theme-toggle .moon { display: none; }
.dark .theme-toggle .sun { display: block; }

/* ── Shared Components ── */
.social-link {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--icon-bg);
    color: var(--icon-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.5s, color 0.5s, transform 0.2s;
}
.social-link:hover { transform: scale(1.1); }
.social-link:active { transform: scale(0.95); }
.social-link svg { width: 18px; height: 18px; }

/* ── Animations ── */
@keyframes fadeInSubtle {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes revealUp {
    from { transform: translateY(105%); }
    to   { transform: translateY(0); }
}
@keyframes expandWidth {
    from { width: 0; }
    to   { width: 48px; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Forms ── */
.form-group { margin-bottom: 1.5rem; }

.form-label {
    display: block;
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--fg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s, background 0.3s;
}
.form-input:focus {
    border-color: var(--border-focus);
    background: transparent;
}
.form-input::placeholder {
    color: var(--fg-placeholder);
}

.form-textarea {
    width: 100%;
    min-height: 280px;
    padding: 0.75rem 0.85rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--fg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    outline: none;
    resize: vertical;
    transition: border-color 0.3s, background 0.3s;
}
.form-textarea:focus {
    border-color: var(--border-focus);
    background: transparent;
}
.form-textarea::placeholder {
    color: var(--fg-placeholder);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--fg-muted);
    margin-top: 0.35rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
}

.form-btn {
    padding: 0.7rem 1.75rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--icon-fg);
    background: var(--icon-bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}
.form-btn:hover { opacity: 0.85; }
.form-btn:active { transform: scale(0.98); }
.form-btn--secondary {
    background: transparent;
    color: var(--fg-muted);
    border: 1px solid var(--border);
}
.form-btn--secondary:hover { border-color: var(--border-focus); color: var(--fg); }

.form-status {
    font-size: 0.85rem;
    color: var(--fg-muted);
    margin-left: 0.5rem;
}

.toolbar {
    display: flex;
    gap: 2px;
    margin-bottom: 0.5rem;
}

.toolbar-btn {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--fg-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.55rem;
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s, background 0.3s;
    line-height: 1;
}
.toolbar-btn:hover { color: var(--fg); border-color: var(--border-focus); background: transparent; }

/* ── Responsive Nav ── */
@media (max-width: 680px) {
    .nav {
        padding: 1rem 1.5rem;
    }
    .nav-right {
        gap: 1.25rem;
    }
    .nav-links {
        gap: 1.25rem;
    }
    .nav-link {
        font-size: 0.85rem;
    }
}

@media (max-width: 380px) {
    .nav {
        padding: 0.85rem 1.25rem;
    }
}

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
