* {
    box-sizing: border-box;
}

:root {
    --ink: #1f2a2e;
    --muted: #5c686d;
    --paper: #fbfaf7;
    --panel: #ffffff;
    --line: #ddd7cc;
    --evergreen: #294c43;
    --evergreen-2: #18322d;
    --terracotta: #9c4f2f;
    --gold: #c89245;
    --sage: #dbe7df;
    --blue: #dce8ef;
    --rose: #f0dfda;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 14% 8%, rgba(200, 146, 69, 0.11), transparent 26rem),
        radial-gradient(circle at 92% 16%, rgba(41, 76, 67, 0.08), transparent 28rem),
        var(--paper);
    color: var(--ink);
    font-family: ui-serif, Georgia, "Times New Roman", serif;
}

button,
input,
select {
    font: inherit;
}

a {
    color: inherit;
}

.site-header {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 5;
}

.nav {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1180px;
    padding: 16px 22px;
}

.brand {
    color: var(--evergreen);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.18rem;
    font-weight: 850;
    letter-spacing: 0;
    text-decoration: none;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.nav-links a,
.button {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--evergreen);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.9rem;
    font-weight: 750;
    padding: 9px 14px;
    text-decoration: none;
}

.button.primary,
.nav-links a.active {
    background: var(--evergreen);
    border-color: var(--evergreen);
    color: white;
}

.container {
    margin: 0 auto;
    max-width: 1180px;
    padding: 34px 22px 56px;
}

.hero {
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    min-height: calc(100vh - 78px);
    padding-bottom: 34px;
    place-items: center;
}

.botanical-hero {
    position: relative;
}

.botanical-hero::before,
.botanical-hero::after {
    border: 1px solid rgba(41, 76, 67, 0.18);
    border-bottom: 0;
    border-left: 0;
    border-radius: 0 42px 0 0;
    content: "";
    height: 120px;
    position: absolute;
    right: 28px;
    top: 34px;
    width: 120px;
    z-index: -1;
}

.botanical-hero::after {
    border-color: rgba(156, 79, 47, 0.16);
    height: 74px;
    right: 76px;
    top: 82px;
    width: 74px;
}

.hero-copy {
    max-width: 780px;
    position: relative;
}

.hero-copy::after {
    background:
        radial-gradient(ellipse at 42% 82%, rgba(41, 76, 67, 0.24) 0 18%, transparent 20%),
        radial-gradient(ellipse at 55% 54%, rgba(41, 76, 67, 0.18) 0 16%, transparent 18%),
        linear-gradient(135deg, transparent 47%, rgba(41, 76, 67, 0.25) 48% 52%, transparent 53%);
    content: "";
    height: 86px;
    left: 2px;
    opacity: 0.8;
    position: absolute;
    top: -118px;
    width: 124px;
}

.eyebrow {
    color: var(--terracotta);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.8rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    line-height: 1.08;
    margin: 0;
}

h1 {
    color: var(--evergreen-2);
    font-size: clamp(3rem, 7vw, 6.4rem);
    letter-spacing: 0;
    margin-top: 12px;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.15rem;
}

.lead {
    color: var(--muted);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.18rem;
    line-height: 1.65;
    margin: 22px 0;
    max-width: 760px;
}

.definition {
    border-left: 4px solid var(--gold);
    color: var(--ink);
    font-size: 1.08rem;
    line-height: 1.6;
    margin: 24px 0;
    max-width: 760px;
    padding-left: 18px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.hero-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f5f1e9 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    position: relative;
    width: 100%;
}

.hero-panel::before {
    background:
        linear-gradient(135deg, rgba(200, 146, 69, 0.13), transparent 42%),
        radial-gradient(circle at 92% 18%, rgba(41, 76, 67, 0.12), transparent 26%);
    border-radius: inherit;
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.hero-panel > * {
    position: relative;
}

.botanical-mark {
    border-left: 1px solid rgba(41, 76, 67, 0.32);
    height: 54px;
    margin-bottom: 18px;
    position: relative;
    width: 120px;
}

.botanical-mark::before,
.botanical-mark::after {
    background: rgba(41, 76, 67, 0.16);
    border: 1px solid rgba(41, 76, 67, 0.2);
    border-radius: 100% 0 100% 0;
    content: "";
    height: 28px;
    left: 22px;
    position: absolute;
    top: 5px;
    transform: rotate(18deg);
    width: 48px;
}

.botanical-mark::after {
    background: rgba(200, 146, 69, 0.14);
    left: 58px;
    top: 22px;
    transform: rotate(-28deg);
}

.mosaic-strip {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(5, 1fr);
    margin: -6px 0 20px;
    max-width: 230px;
}

.mosaic-strip span {
    aspect-ratio: 1;
    border: 1px solid rgba(31, 42, 46, 0.12);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.mosaic-strip span:nth-child(1) {
    background: linear-gradient(135deg, var(--evergreen), #517469);
}

.mosaic-strip span:nth-child(2) {
    background: linear-gradient(135deg, var(--gold), #e5c37a);
}

.mosaic-strip span:nth-child(3) {
    background: linear-gradient(135deg, var(--terracotta), #c27c55);
}

.mosaic-strip span:nth-child(4) {
    background: linear-gradient(135deg, #213c5a, #506a86);
}

.mosaic-strip span:nth-child(5) {
    background: linear-gradient(135deg, var(--rose), #f7eee8);
}

.quote {
    color: var(--ink);
    font-size: 1.3rem;
    line-height: 1.55;
}

.stats {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 22px;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.stat strong {
    color: var(--evergreen);
    display: block;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.4rem;
}

.section-head {
    align-items: end;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-head p {
    color: var(--muted);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    margin: 8px 0 0;
    max-width: 760px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.toolbar input,
.toolbar select {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 42px;
    padding: 9px 11px;
}

.toolbar input {
    flex: 1;
    min-width: 240px;
}

.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pocket-card,
.path-card,
.detail-panel,
.builder-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.pocket-card {
    display: flex;
    flex-direction: column;
    min-height: 270px;
}

.card-top {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.meta,
.small {
    color: var(--muted);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.9rem;
    line-height: 1.45;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.badge {
    background: var(--sage);
    border-radius: 999px;
    color: var(--evergreen);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 5px 9px;
}

.badge.secondary {
    background: var(--blue);
    color: #24475a;
}

.badge.status {
    background: #f4ead9;
    color: #72501a;
}

.card-spacer {
    flex: 1;
}

.card-link {
    color: var(--terracotta);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 800;
    margin-top: 14px;
    text-decoration: none;
}

.path-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.builder-layout {
    align-items: start;
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr) 340px;
}

.progress-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 110px 1fr 56px;
    margin: 12px 0;
}

.progress-track {
    background: #ece8df;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.progress-fill {
    background: var(--evergreen);
    height: 100%;
    min-width: 0;
}

.select-row {
    align-items: start;
    display: grid;
    gap: 12px;
    grid-template-columns: 24px 1fr;
    margin-top: 12px;
}

.select-row input {
    margin-top: 3px;
}

.detail-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) 340px;
}

.list {
    margin: 12px 0 0;
    padding-left: 20px;
}

.list li {
    margin: 7px 0;
}

.compact {
    margin: 12px 0;
}

.pocket-content-head {
    align-items: end;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-top: 28px;
    padding-top: 24px;
}

.branch-select {
    color: var(--evergreen);
    display: grid;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    gap: 6px;
    min-width: 190px;
}

.branch-select select {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    min-height: 42px;
    padding: 9px 11px;
}

.notebook-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.notebook-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.notebook-card summary {
    align-items: center;
    background: #f6f1e8;
    cursor: pointer;
    display: flex;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 850;
    gap: 12px;
    justify-content: space-between;
    padding: 14px 16px;
}

.notebook-card summary small {
    color: var(--muted);
    font-weight: 700;
}

.notebook-body {
    padding: 16px;
}

.notebook-body h3 {
    color: var(--evergreen);
    margin-top: 18px;
}

.notebook-body h3:first-child {
    margin-top: 0;
}

.branch-panel {
    background: #fbf6ed;
    border: 1px solid #e7cda9;
    border-radius: 8px;
    margin-top: 20px;
    padding: 16px;
}

.login-page {
    align-items: stretch;
    display: grid;
    min-height: 100vh;
    overflow-x: hidden;
    padding: 20px;
    place-items: center;
}

.login-shell {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.7fr);
    max-width: 1040px;
    width: 100%;
}

.login-story {
    align-content: center;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.52), rgba(245, 241, 233, 0.72)),
        radial-gradient(circle at 18% 22%, rgba(200, 146, 69, 0.15), transparent 18rem);
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 620px;
    padding: 38px;
    position: relative;
}

.login-story::before {
    background:
        radial-gradient(ellipse at 38% 76%, rgba(41, 76, 67, 0.22) 0 18%, transparent 20%),
        radial-gradient(ellipse at 56% 45%, rgba(41, 76, 67, 0.16) 0 16%, transparent 18%),
        linear-gradient(135deg, transparent 47%, rgba(41, 76, 67, 0.24) 48% 52%, transparent 53%);
    content: "";
    height: 150px;
    position: absolute;
    right: 34px;
    top: 28px;
    width: 190px;
}

.login-story h1 {
    font-size: clamp(3.2rem, 8vw, 6.8rem);
    max-width: 620px;
}

.pocket-flow {
    color: var(--evergreen);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.92rem;
    font-weight: 850;
    line-height: 1.5;
    margin: 20px 0 0;
}

.login-mosaic {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(4, minmax(54px, 78px));
    margin-top: 34px;
}

.login-mosaic span {
    aspect-ratio: 1;
    border: 1px solid rgba(31, 42, 46, 0.12);
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(31, 42, 46, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.login-mosaic span:nth-child(1),
.login-mosaic span:nth-child(7) {
    background: linear-gradient(135deg, var(--evergreen), #4b7164);
}

.login-mosaic span:nth-child(2),
.login-mosaic span:nth-child(6) {
    background: linear-gradient(135deg, var(--gold), #e4be73);
}

.login-mosaic span:nth-child(3),
.login-mosaic span:nth-child(8) {
    background: linear-gradient(135deg, var(--terracotta), #bf7451);
}

.login-mosaic span:nth-child(4) {
    background: linear-gradient(135deg, #203a57, #647d95);
}

.login-mosaic span:nth-child(5) {
    background: linear-gradient(135deg, var(--rose), #f8eee9);
}

.login-card {
    align-self: center;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(31, 42, 46, 0.12);
    padding: 32px;
}

.login-card .back-link {
    margin-bottom: 22px;
}

.login-card .back-link a,
.login-secondary-link {
    color: var(--evergreen);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    text-decoration: none;
}

.login-heading {
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
    padding-bottom: 20px;
}

.login-heading h2 {
    color: var(--evergreen-2);
    font-size: 2.2rem;
}

.login-form-group {
    margin-bottom: 20px;
}

.login-form-group label {
    color: var(--evergreen);
    display: block;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.94rem;
    font-weight: 850;
    margin-bottom: 8px;
}

.login-form-group input {
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    min-height: 54px;
    padding: 13px 15px;
    width: 100%;
}

.login-form-group input:focus {
    border-color: var(--evergreen);
    box-shadow: 0 0 0 4px rgba(41, 76, 67, 0.12);
    outline: none;
}

.login-form-group input#pin {
    letter-spacing: 0.4em;
    text-align: center;
}

.login-submit {
    background: var(--evergreen);
    border: 0;
    border-radius: 999px;
    color: white;
    cursor: pointer;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    font-weight: 850;
    min-height: 52px;
    padding: 14px 18px;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    width: 100%;
}

.login-submit:hover {
    background: var(--terracotta);
    box-shadow: 0 14px 28px rgba(156, 79, 47, 0.18);
    transform: translateY(-2px);
}

.login-submit:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.login-text-button {
    background: none;
    border: 0;
    color: var(--evergreen);
    cursor: pointer;
    display: inline-flex;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.92rem;
    font-weight: 850;
    margin: -4px 0 18px;
    padding: 0;
}

.login-text-button:hover {
    color: var(--terracotta);
}

.login-text-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.message {
    border-radius: 8px;
    display: none;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.95rem;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.message.success {
    background: var(--sage);
    border: 1px solid rgba(41, 76, 67, 0.2);
    color: var(--evergreen-2);
}

.message.error {
    background: var(--rose);
    border: 1px solid rgba(146, 61, 75, 0.25);
    color: #73303a;
}

.login-help {
    color: var(--muted);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.94rem;
    line-height: 1.5;
    margin-top: 22px;
    text-align: center;
}

.login-footer-link {
    border-top: 1px solid var(--line);
    margin-top: 22px;
    padding-top: 18px;
}

@media (max-width: 820px) {
    .hero,
    .builder-layout,
    .login-shell,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-links {
        justify-content: flex-start;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .pocket-content-head {
        align-items: stretch;
        flex-direction: column;
    }

    .login-page {
        padding: 12px;
    }

    .login-story {
        min-height: auto;
        order: 2;
        padding: 28px;
    }

    .login-story::before,
    .hero-copy::after,
    .botanical-hero::before,
    .botanical-hero::after {
        display: none;
    }

    .login-card {
        order: 1;
        padding: 24px;
    }
}
