/* Arbutus Audio. Three colours, from the look-alike model: beige, brown, green. */
:root {
    --beige: #fce0a7;
    --brown: #8c3c03;
    --green: #1b5c22;
    /* derived shades: the three colours mixed with each other or white */
    --bg: var(--beige);
    --cap: #fdeccb;         /* beige lightened, cards and keycaps */
    --bg-deep: #f5d18f;     /* beige toward brown, inset cards */
    --ink: var(--brown);
    --ink-soft: #7a4a20;    /* brown toward beige */
    --orange: var(--brown);
    --green-soft: var(--green);
    --blue: var(--green);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow: 0 10px 30px rgba(140, 60, 3, 0.14);
    --shadow-sm: 0 3px 10px rgba(140, 60, 3, 0.14);
    --maxw: 1232px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 110% = one Cmd+ step in Safari; rem sizes and the px containers below scale with it */
html { font-size: 110%; scroll-behavior: smooth; }
/* Anchor jumps: the target's visible content lands 1rem below the sticky header (--header-h: its
   measured height). A section's own top padding is subtracted so the card, not the padding, lines up. */
:root { --header-h: 78px; }
[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }
.mission[id] { scroll-margin-top: calc(var(--header-h) + 1rem - 3rem); }
.mission + .mission[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }
.log[id] { scroll-margin-top: calc(var(--header-h) + 1rem - 2rem); }

body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.125rem;
    line-height: 1.65;
    color: var(--ink);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(2.6rem, 5.4vw, 4rem); line-height: 1.08; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.35rem; }
.h1-lead { display: block; font-size: 0.55em; font-weight: 500; margin-bottom: 0.35em; color: var(--green); }
p { margin-bottom: 1rem; }
a { color: var(--brown); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* Buttons: pills, like the keycap outlines on the panel */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.7rem 1.5rem;
    border-radius: 999px;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.2;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: var(--cap); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green); }
.btn-ghost { background: transparent; color: var(--brown); border-color: var(--brown); }
.btn-ghost:hover { background: rgba(140, 60, 3, 0.08); }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.8rem 1.25rem;
    background: rgba(252, 224, 167, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(140, 60, 3, 0.15);
}
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--ink); font-weight: 600; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 44px; height: 44px; }
.site-nav { display: flex; gap: 0.35rem; }
.site-nav a {
    padding: 0.45rem 1rem; border-radius: 999px; font-weight: 500; color: var(--ink-soft);
}
.site-nav a:hover { background: rgba(140, 60, 3, 0.10); color: var(--ink); text-decoration: none; }

/* Hamburger: shown only when the nav no longer fits beside the brand */
.nav-toggle {
    display: none;
    flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 44px; height: 44px;
    border: 0; border-radius: 999px;
    background: transparent; color: var(--ink);
    cursor: pointer;
}
.nav-toggle:hover, .nav-toggle[aria-expanded="true"] { background: rgba(140, 60, 3, 0.10); }
.nav-toggle span {
    display: block; width: 20px; height: 2px; border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
    max-width: var(--maxw); margin: 0 auto;
    padding: 3.5rem 1.25rem 2rem;
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2.5rem; align-items: center;
}
.hero h1 { margin-bottom: 1rem; }
.lede { font-size: 1.25rem; color: var(--ink-soft); }
.hero-image img {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    aspect-ratio: 4 / 3; object-fit: cover; width: 100%;
}
.hero-image figcaption { font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.75rem; text-align: center; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Intro: portrait beside the opening */
/* the photo floats left, so text past its bottom wraps under it; on a phone it sits above the text */
.intro { display: flow-root; margin-bottom: 0.5rem; }
.portrait { margin: 0; float: left; width: 220px; margin: 0 2rem 1rem 0; }
.portrait img { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
.portrait figcaption { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.6rem; text-align: center; }
.intro-text h2 { margin-bottom: 1rem; }
.intro-text p:last-child { margin-bottom: 0; }

/* Mission */
.mission { padding: 3rem 1.25rem; }
.mission + .mission { padding-top: 0; }
.mission-inner {
    --card-pad: clamp(1.5rem, 4vw, 3rem);
    max-width: 946px; margin: 0 auto;
    background: var(--cap);
    /* outer radius = inner radius + padding, so the border reads as one width around the corner */
    border-radius: calc(var(--radius-lg) + var(--card-pad));
    padding: var(--card-pad);
    box-shadow: var(--shadow);
}
.mission h2 { margin-bottom: 1.25rem; }
.mission-sub { font-size: 1.25rem; margin: 1.75rem 0 0.75rem; }

/* Cost stack (#pricing): one bar at a batch of 25, each layer's height its share of the price,
   labelled beside it; a layer grows past its share only if its label needs the room */
.cost-date { font-size: 0.9rem; color: var(--ink-soft); margin-top: 1rem; }
.stack-total { font-size: 1.5rem; font-weight: 600; }
.stack-total span { font-size: 1rem; font-weight: 400; color: var(--ink-soft); }
.stack { display: flex; flex-direction: column; height: 30rem; }
.stack-layer { flex: 0 1 0; display: flex; align-items: center; gap: 0.75rem; }
.stack-seg { align-self: stretch; flex: none; width: 6rem; border-bottom: 2px solid var(--bg); }
.stack-layer:first-child .stack-seg { border-radius: 8px 8px 0 0; }
.stack-layer:last-child .stack-seg { border-radius: 0 0 8px 8px; border-bottom: none; }
.stack-label { font-size: 0.95rem; line-height: 1.3; }
.stack-label b { font-weight: 600; white-space: nowrap; }
/* the bar and the curves side by side; the curves drop below the bar on a narrow screen */
.cost-charts { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: 2.5rem; margin-top: 1.75rem; }
#pricing .cost-chart h3 { font-size: 1.1rem; margin: 0; }
.cost-chart .stack-total { margin: 0.25rem 0 0.75rem; }
.chart-sub { font-size: 1rem; color: var(--ink-soft); margin: 0.25rem 0 0.75rem; line-height: 2.1rem; }
.curve { display: block; width: 100%; height: auto; overflow: visible; }
.curve text { font-family: inherit; font-size: 12px; fill: var(--ink-soft); }
.curve text.total { font-size: 13px; font-weight: 600; fill: var(--ink); }
.curve .grid { stroke: var(--bg-deep); stroke-width: 1; }
.curve .band { stroke: var(--cap); stroke-width: 1.5; stroke-linejoin: round; }
.curve .price { fill: none; stroke: var(--ink); stroke-width: 2; }
.curve circle { fill: var(--ink); stroke: var(--cap); stroke-width: 2; }
@media (max-width: 760px) {
    .cost-charts { grid-template-columns: minmax(0, 1fr); }
    .curve text { font-size: 17px; }            /* the chart shrinks to the phone; its text should not */
    .curve text.total { font-size: 18px; }
    .chart-sub { line-height: 1.4; }
}
.pillars { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.5rem; margin: 1.5rem 0 1.75rem; }
.pillars li { display: flex; gap: 0.9rem; align-items: flex-start; }
.pillars h3 { font-size: 1.6rem; margin-bottom: 0.3rem; color: var(--green); }
.pillars p { font-size: 1rem; margin-bottom: 0; color: var(--ink-soft); }
/* dot centred on the h3's first line: (h3 line box - dot) / 2 */
.pillar-mark { flex: 0 0 0.8rem; width: 0.8rem; height: 0.8rem; border-radius: 50%; margin-top: calc((1.6rem * 1.15 - 0.8rem) / 2); }
.pillar-green { background: var(--green); }
.pillar-brown { background: var(--green); }

.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 2rem; }
.contact-card {
    background: var(--bg-deep);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex; flex-direction: column;
}
.contact-card h3 { margin-bottom: 0.5rem; }
.contact-card p { font-size: 1rem; color: var(--ink-soft); flex: 1; }
.contact-card .btn { align-self: flex-start; }
.signup { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.signup input {
    flex: 1 1 180px; min-width: 0;
    font: inherit; font-size: 1rem;
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    border: 2px solid var(--brown);
    background: var(--cap);
    color: var(--ink);
}
.signup input:focus { outline: 3px solid rgba(140, 60, 3, 0.3); outline-offset: 1px; }
.signup-status { flex-basis: 100%; margin: 0.25rem 0 0; font-size: 0.95rem; color: var(--green); min-height: 1.2em; }

/* Log */
.log { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.log-head { text-align: center; margin-bottom: 2.5rem; }
.log-head p { color: var(--ink-soft); }
.post { max-width: 990px; margin: 0 auto 3.5rem; }
.post-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.date {
    font-weight: 500; color: var(--cap); background: var(--green);
    padding: 0.25rem 0.9rem; border-radius: 999px; font-size: 0.9rem;
}
.tag { font-weight: 500; color: var(--ink-soft); font-size: 0.9rem; }
.post h3 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin-bottom: 1rem; }
.post-body { max-width: 836px; }
.post-body p:last-child { margin-bottom: 0; }

.ladder { list-style: none; margin: 1.25rem 0 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.ladder li {
    display: grid; grid-template-columns: auto 1fr auto; gap: 0.9rem; align-items: center;
    background: var(--cap); border-radius: var(--radius-md); padding: 0.6rem 1rem; font-size: 1rem;
}
.rung {
    font-weight: 600; color: var(--brown); background: rgba(140, 60, 3, 0.12);
    border-radius: 999px; padding: 0.2rem 0.7rem; min-width: 3.2rem; text-align: center;
}
.rung.done { color: var(--cap); background: var(--green); }
.rung.next { color: var(--cap); background: var(--orange); }
.status { font-weight: 500; color: var(--ink-soft); font-size: 0.9rem; white-space: nowrap; }

/* Carousel */
.carousel {
    position: relative;
    margin: 0 0 1.5rem;
    background: var(--bg-deep);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.carousel-container { position: relative; width: 100%; overflow: hidden; display: grid; }
.carousel-slide { grid-area: 1 / 1; align-self: center; width: 100%; text-align: center; padding: 1rem 1rem 0.5rem; visibility: hidden; }
.carousel-slide.active { visibility: visible; }
.carousel-slide img {
    max-height: 600px; width: auto; max-width: 100%;
    margin: 0 auto; border-radius: var(--radius-lg);
    cursor: zoom-in;
}
.caption { margin: 0.9rem auto 0.5rem; color: var(--ink-soft); font-size: 1rem; max-width: 704px; }

.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--cap); color: var(--brown);
    border: 2px solid var(--brown);
    font-size: 1.9rem; line-height: 1; padding: 0 0 4px;
    cursor: pointer; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.2s, transform 0.12s;
    font-family: inherit;
}
.carousel-btn:hover { background: var(--orange); color: var(--cap); border-color: var(--orange); }
.carousel-btn.prev { left: 1rem; }
.carousel-btn.next { right: 1rem; }

.carousel-indicators { text-align: center; padding: 0.2rem 0 0.9rem; }
.indicator {
    display: inline-block; width: 11px; height: 11px; margin: 0 4px;
    background: rgba(140, 60, 3, 0.28); border-radius: 50%; cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}
.indicator.active { background: var(--orange); transform: scale(1.2); }
.carousel-indicators:empty, .carousel-indicators.single { display: none; }

/* Lightbox */
.lightbox-modal {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: rgba(70, 30, 2, 0.94);
    align-items: center; justify-content: center;
}
.lightbox-modal.active { display: flex; }
.lightbox-close {
    position: absolute; top: 1.25rem; right: 1.25rem;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--cap); color: var(--brown); border: none;
    font-size: 2rem; line-height: 1; cursor: pointer; z-index: 1001;
    font-family: inherit;
}
.lightbox-content { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 94vw; max-height: 92vh; position: relative; }
.lightbox-inner { display: flex; flex-direction: column; align-items: center; max-width: 100%; }
.lightbox-modal img { max-width: 84vw; max-height: 78vh; object-fit: contain; border-radius: var(--radius-md); }
.lightbox-caption { color: var(--bg); font-size: 1.05rem; margin-top: 1rem; text-align: center; max-width: 80vw; }
.lightbox-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--cap); color: var(--brown); border: none;
    font-size: 2rem; line-height: 1; padding: 0 0 4px; cursor: pointer; z-index: 1001;
    font-family: inherit;
}
.lightbox-btn.prev { left: 1.25rem; }
.lightbox-btn.next { right: 1.25rem; }
.lightbox-btn:hover, .lightbox-close:hover, .carousel-btn:focus-visible { background: var(--orange); color: var(--cap); }

/* Footer */
.site-footer {
    text-align: center; padding: 3rem 1.25rem 3.5rem;
    border-top: 1px solid rgba(140, 60, 3, 0.15);
    color: var(--ink-soft);
}
.footer-mark { margin: 0 auto 0.9rem; }
.site-footer p { margin-bottom: 0.4rem; }
.footer-fine { font-size: 0.9rem; }

/* Responsive */
@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; gap: 1.75rem; padding-top: 2.25rem; }
    .hero-text { order: 2; }
    .hero-image { order: 1; }
    .pillars, .contact-row { grid-template-columns: 1fr; }
    .portrait { float: none; width: auto; max-width: 260px; margin: 0 0 1.25rem; }
}
/* Below this width the brand and the three links crowd each other: links move into a
   small card that drops from the hamburger, anchored to the header's right edge. */
@media (max-width: 680px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: absolute; top: calc(100% + 0.5rem); right: 1rem;
        flex-direction: column; gap: 0.15rem;
        min-width: 11rem; padding: 0.5rem;
        background: var(--cap);
        border: 1px solid rgba(140, 60, 3, 0.15);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow);
        transform-origin: top right;
        opacity: 0; visibility: hidden;
        transform: translateY(-6px) scale(0.96);
        transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
    }
    .site-header.nav-open .site-nav {
        opacity: 1; visibility: visible; transform: none;
        transition: opacity 0.16s ease, transform 0.16s ease;
    }
    .site-nav a { padding: 0.6rem 1rem; font-size: 1.05rem; color: var(--ink); }
}
@media (max-width: 600px) {
    body { font-size: 1.05rem; }
    .site-header { padding: 0.6rem 1rem; }
    :root { --header-h: 66px; }
    .brand-name { font-size: 1rem; }
    .hero, .mission, .log { padding-left: 1rem; padding-right: 1rem; }
    .hero-image img { border-radius: var(--radius-lg); }
    .carousel { border-radius: var(--radius-lg); }
    .carousel-slide { padding: 0.6rem 0.6rem 0.25rem; }
    .carousel-slide img { max-height: 420px; border-radius: var(--radius-md); }
    .carousel-btn { width: 40px; height: 40px; font-size: 1.6rem; }
    .carousel-btn.prev { left: 0.5rem; }
    .carousel-btn.next { right: 0.5rem; }
    .ladder li { grid-template-columns: auto 1fr; }
    .ladder .status { grid-column: 2; }
    .lightbox-modal img { max-width: 92vw; max-height: 66vh; }
    .lightbox-btn.prev { left: 0.4rem; }
    .lightbox-btn.next { right: 0.4rem; }
}

/* Continuous-curvature corners (no jump from straight edge into the arc). Browsers that
   lack corner-shape keep plain circular corners. A superellipse reads tighter than a
   circle of the same radius, so the radii grow ~20% to hold the same visual weight. */
@supports (corner-shape: squircle) {
    :root { --radius-xl: 38px; --radius-lg: 29px; --radius-md: 19px; }
    .hero-image img, .portrait img, .mission-inner, .contact-card, .ladder li,
    .carousel, .carousel-slide img, .lightbox-modal img {
        corner-shape: superellipse(1.5);
    }
}
