/* Relative Industries — shared design language.
   Warm white, clay and blue, honest black. Bold friendly headlines,
   a soft italic for warmth, and hand-drawn illustration. */

:root {
    --white: #FFFFFF;
    --paper: #FBF8F4;
    --sand: #F4EEE6;
    --ink: #1B1917;
    --ink-2: rgba(27, 25, 23, 0.70);
    --ink-3: rgba(27, 25, 23, 0.60); /* AA on paper and white */
    --hair: rgba(27, 25, 23, 0.12);
    --hair-2: rgba(27, 25, 23, 0.48); /* 3:1 for input and chip edges */
    --clay: #B04F2F;
    --clay-deep: #93401F;
    --clay-wash: #F7E6DC;
    --blue: #2F5BFF;
    --blue-wash: #E3E9FF;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
    --soft: 'Fraunces', Georgia, serif;
    --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --gutter: clamp(18px, 4vw, 48px);
    --max: 1180px;
    --r: 24px;
    --shadow: 0 1px 2px rgba(27,25,23,0.06), 0 12px 32px -12px rgba(27,25,23,0.18);
    --pop: 4px 4px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
::selection { background: var(--clay-wash); }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
html, body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, label:focus-within {
    outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px;
}

.shell { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- type ---------- */
.mono, .eyebrow {
    font-family: var(--sans); font-size: 13px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--clay-deep); /* clay-deep keeps small labels at AA */
}
.mono b { color: var(--ink); font-weight: 700; }
.mono.quiet { color: var(--ink-3); }
.display {
    font-family: var(--display); font-weight: 800;
    font-size: clamp(52px, 9.4vw, 124px);
    line-height: 0.95; letter-spacing: -0.035em;
    margin: 0;
}
.display em, .h2 em, .lead em, h1 em, h3 em {
    font-family: var(--soft); font-style: italic; font-weight: 500;
    color: var(--clay); letter-spacing: -0.02em;
}
.h2 {
    font-family: var(--display); font-weight: 800;
    font-size: clamp(36px, 5.2vw, 64px);
    line-height: 1.02; letter-spacing: -0.03em;
    margin: 0;
}
.lead {
    font-family: var(--display); font-weight: 600;
    font-size: clamp(26px, 3.2vw, 38px);
    line-height: 1.2; letter-spacing: -0.02em;
    margin: 0;
}
.body { color: var(--ink-2); font-size: 18px; max-width: 34em; margin: 0; }
h1, h2, h3, .display, .h2, .lead { text-wrap: balance; }
p, li { text-wrap: pretty; }
.small { font-size: 15px; color: var(--ink-2); }

/* ---------- nav ---------- */
.nav-wrap { position: sticky; top: 0; z-index: 30; }
.nav {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 16px var(--gutter);
    max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
    transition: background 300ms ease, box-shadow 300ms ease;
}
.nav.solid {
    background: rgba(251, 248, 244, 0.86);
    -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
    box-shadow: 0 1px 0 var(--hair);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.wordmark svg { width: 22px; height: 22px; color: var(--clay); }
.wordmark .tile { fill: currentColor; }
@keyframes tileWave { 0% { opacity: 1; } 38% { opacity: 0.15; } 100% { opacity: 1; } }
.wordmark:hover .tile { animation: tileWave 900ms var(--ease) both; }
.wordmark:hover .tile:nth-child(n+3) { animation-delay: 90ms; }
.wordmark:hover .tile:nth-child(n+7) { animation-delay: 180ms; }
.wordmark:hover .tile:nth-child(n+11) { animation-delay: 270ms; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink-2); transition: color 160ms ease; }
.nav-links a:hover { color: var(--ink); }
.nav-links a:not(.btn) { padding: 10px 0; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    font: 700 16px/1 var(--sans);
    padding: 16px 24px; border-radius: 999px;
    border: 2px solid var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), background 200ms ease, color 200ms ease;
}
.btn-ink, .btn-clay { background: var(--clay); color: var(--white); box-shadow: var(--pop); }
.btn-ink:hover, .btn-clay:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn-ink:active, .btn-clay:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-line { background: var(--white); color: var(--ink); box-shadow: 0 0 0 var(--ink); }
.btn-line:hover { background: var(--sand); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.btn-line:active { transform: translate(0, 0); box-shadow: 1px 1px 0 var(--ink); }
.btn-sm { padding: 11px 18px; font-size: 15px; box-shadow: 3px 3px 0 var(--ink); }
.btn-sm:hover { box-shadow: 4px 4px 0 var(--ink); }
.btn .arr { transition: transform 260ms var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.textlink { text-decoration: none; font-weight: 600; color: var(--ink); border-bottom: 2px solid var(--clay); padding-bottom: 1px; transition: color 160ms ease; }
.textlink:hover { color: var(--clay-deep); border-bottom-color: var(--clay-deep); }

/* ---------- sections ---------- */
.section { padding: clamp(88px, 12vw, 160px) 0 0; }
.rule { height: 1px; background: var(--hair); border: 0; margin: 0; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); margin-bottom: 36px; }
.label-row.bare { border-bottom: 0; padding-bottom: 0; margin-bottom: 28px; }
.card {
    background: var(--white);
    border: 2px solid var(--ink);
    border-radius: var(--r);
    box-shadow: var(--pop);
}

/* ---------- illustrations ---------- */
.illus { display: block; height: auto; }
.spot { width: 88px; height: 74px; flex: none; }
/* the drawings sit ~15% inside their canvas; pull standalone ones back so their ink lines up with the text edge */
.illus.flush { margin-left: -16px; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.bob { animation: bob 6s ease-in-out infinite; }

/* ---------- the week (signature visual) ---------- */
.week { --cell: clamp(22px, 4.4vw, 42px); }
.week-grid { display: grid; grid-template-columns: 48px repeat(5, 1fr); gap: 6px; }
.week-grid .dh, .week-grid .th { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; }
.week-grid .dh { padding-bottom: 6px; }
.week-grid .th { align-self: center; }
.week-cell {
    position: relative;
    height: var(--cell);
    border-radius: 9px;
    background: var(--white);
    box-shadow: inset 0 0 0 1.5px var(--hair);
    transition: background 700ms var(--ease), box-shadow 700ms var(--ease), transform 500ms var(--ease);
}
.week-cell.admin {
    background: repeating-linear-gradient(135deg, rgba(198,93,59,0.38) 0 2px, transparent 2px 7px), var(--clay-wash);
    box-shadow: inset 0 0 0 1.5px rgba(198, 93, 59, 0.45);
}
.week-cell.back { background: var(--blue); box-shadow: inset 0 0 0 1.5px var(--ink); }
.week-cell.back::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 8px; height: 8px; background: var(--white); border-radius: 2px;
    transform: translate(-50%, -50%) rotate(45deg);
    animation: pop 600ms var(--ease) both;
}
@keyframes pop { from { transform: translate(-50%, -50%) rotate(45deg) scale(0); } }
.week-cell[data-tip]:hover { transform: translateY(-2px); z-index: 2; }
.week-cell[data-tip]:hover::before {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    white-space: nowrap; font: 600 13px/1 var(--sans);
    padding: 9px 11px; border-radius: 10px; background: var(--ink); color: var(--white);
    pointer-events: none;
}
.week-legend { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-top: 18px; }
.week-legend span { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.week-legend i { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }
.week-legend .k-admin { background: repeating-linear-gradient(135deg, rgba(198,93,59,0.45) 0 2px, transparent 2px 5px), var(--clay-wash); box-shadow: inset 0 0 0 1.5px rgba(198,93,59,0.5); }
.week-legend .k-back { background: var(--blue); box-shadow: inset 0 0 0 1.5px var(--ink); }
.week-count { font-family: var(--display); font-weight: 800; font-size: clamp(48px, 6vw, 76px); line-height: 1; letter-spacing: -0.04em; color: var(--blue); }
.week-count small { font-family: var(--sans); font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-left: 10px; }

/* ---------- index rows ---------- */
.rows { border-top: 2px solid var(--ink); }
.row {
    display: grid;
    grid-template-columns: 96px 1.1fr 1fr 120px;
    gap: 24px;
    align-items: center;
    padding: 26px 0;
    border-bottom: 1px solid var(--hair);
    transition: background 300ms ease;
}
.row .n { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--clay-deep); }
.row h3 { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
.row p { margin: 0; color: var(--ink-2); font-size: 16px; }
.row .t { font-weight: 700; font-size: 14px; color: var(--blue); text-align: right; white-space: nowrap; }

/* ---------- forms ---------- */
.field { display: grid; gap: 8px; }
.field label, .field .lbl { font-size: 14px; font-weight: 700; color: var(--ink); }
.input, .select, .textarea {
    width: 100%;
    font: 500 17px/1.4 var(--sans);
    color: var(--ink);
    background: var(--white);
    border: 2px solid var(--hair-2);
    border-radius: 14px;
    padding: 14px 16px;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
.textarea { resize: vertical; min-height: 104px; }
.select { -webkit-appearance: none; appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%231B1917' stroke-width='2'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 3px 3px 0 var(--clay); }
.input.invalid, .select.invalid { border-color: #C0392B; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.field .chip, .chip {
    position: relative; display: inline-flex; align-items: center;
    padding: 10px 15px; border-radius: 999px;
    border: 2px solid var(--hair-2); background: var(--white);
    font: 600 15px/1.2 var(--sans); color: var(--ink); text-transform: none; letter-spacing: 0;
    cursor: pointer; user-select: none;
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip:active { transform: translateY(1px); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.field .chip:has(input:checked), .chip:has(input:checked) { background: var(--blue); border-color: var(--ink); color: var(--white); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- people ---------- */
.people { display: flex; align-items: center; gap: 14px; }
.faces { display: flex; flex: none; }
.faces img { flex: none; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); background: var(--sand); }
.faces img + img { margin-left: -12px; }

/* ---------- footer ---------- */
.foot {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px;
    padding: 28px 0 40px; margin-top: clamp(88px, 12vw, 150px);
    border-top: 2px solid var(--ink);
}
.foot a { text-decoration: none; }

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(16px); transition: opacity 900ms var(--ease), transform 900ms var(--ease); }
.rv.in { opacity: 1; transform: none; }
.rise { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.rise > span { display: inline-block; animation: rise 1000ms var(--ease) both; }
.rise:nth-child(2) > span { animation-delay: 110ms; }
.rise:nth-child(3) > span { animation-delay: 220ms; }
@keyframes rise { from { transform: translateY(110%); } }

/* specificity guards */
.nav-links .btn-ink, .nav-links .btn-ink:hover { color: var(--white); }

@media (max-width: 760px) {
    body { font-size: 16px; }
    .hide-sm { display: none; }
    .row { grid-template-columns: 64px 1fr; gap: 6px 16px; padding: 22px 0; align-items: start; }
    .row .spot { width: 56px; height: 48px; }
    .row p, .row .t { grid-column: 2; }
    .row .t { text-align: left; }
    .week-grid { grid-template-columns: 30px repeat(5, 1fr); gap: 4px; }
    .week-cell { border-radius: 6px; }
    .week-cell[data-tip]:hover::before { display: none; }
    .label-row { margin-bottom: 26px; flex-direction: column; align-items: flex-start; gap: 4px; }
    .row > .spot { grid-row: 1 / span 3; }
    .chip, .btn-sm { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .rv { opacity: 1; transform: none; }
}
.label-row + .rows { border-top: 0; }

/* form send failure */
.form-error { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--clay-wash); color: var(--ink); font-size: 15px; }
.form-error a { color: var(--clay-deep); font-weight: 700; }
