@font-face {
    font-family: berkeley;
    src: url(../font/berkeley.woff2) format(woff2);
    font-display: swap;
}

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

:root {
    --bg: #fafafa;
    --bg-alt: #ffffff;
    --text: #1a1a1a;
    --text-muted: #666666;
    --border: #e0e0e0;
    --accent: #00909E;
    --accent-hover: #007a87;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --bg: #0f0f0f;
    --bg-alt: #1a1a1a;
    --text: #f0f0f0;
    --text-muted: #888888;
    --border: #2a2a2a;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f0f0f;
        --bg-alt: #1a1a1a;
        --text: #f0f0f0;
        --text-muted: #888888;
        --border: #2a2a2a;
        --shadow: 0 1px 3px rgba(0,0,0,0.3);
        --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
    }
}

html {
    font-family: berkeley, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

body {
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    width: 100%;
}

input:focus {
    outline: none;
    border-color: var(--accent);
}

svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: middle;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

header h1 svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--accent);
}

header nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

header nav a {
    color: var(--text-muted);
    transition: color 0.15s;
}

header nav a:hover {
    color: var(--text);
    text-decoration: none;
}

header nav button {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: background 0.15s;
}

header nav button:hover {
    background: var(--border);
}

header nav button svg {
    width: 1.125rem;
    height: 1.125rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    margin-bottom: 2rem;
}

section > header {
    position: static;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 1rem;
}

section > header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

article {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

article + article {
    margin-top: 1rem;
}

article header {
    position: static;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 1rem;
}

article header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

article header p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

ul {
    list-style: none;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

form label {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

form button[type="submit"] {
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: background 0.15s;
}

form button[type="submit"]:hover {
    background: var(--accent-hover);
}

aside {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: var(--bg-alt);
    border-right: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

aside h1 {
    font-size: 1.125rem;
    font-weight: 600;
    padding: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

aside h1 svg {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--accent);
}

aside nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

aside nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    transition: all 0.15s;
}

aside nav a:hover {
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}

aside nav a[aria-current="page"] {
    background: var(--accent);
    color: white;
}

aside nav a svg {
    width: 1rem;
    height: 1rem;
}

aside footer {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
}

aside footer button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    width: 100%;
    border-radius: var(--radius);
    color: var(--text-muted);
    transition: all 0.15s;
}

aside footer button:hover {
    background: var(--bg);
    color: var(--text);
}

body:has(aside) main {
    margin-left: 240px;
}

body:has(aside) header {
    margin-left: 240px;
}

dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 90%;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

dialog header {
    position: static;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

dialog header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

dialog header button {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

dialog header button:hover {
    background: var(--border);
}

dialog footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

dialog footer button {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
}

dialog footer button:first-child {
    background: var(--border);
}

dialog footer button:last-child {
    background: var(--accent);
    color: white;
}

figure {
    margin: 0;
}

figure figcaption {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    font-family: berkeley, monospace;
    font-size: 0.875rem;
}

code {
    font-family: berkeley, monospace;
    font-size: 0.875rem;
}

mark {
    background: var(--accent);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-weight: 500;
}

dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

dt {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

dd {
    font-size: 1.5rem;
    font-weight: 600;
}

dd small {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted);
}

meter {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
}

meter::-webkit-meter-bar {
    background: var(--border);
    border-radius: 4px;
}

meter::-webkit-meter-optimum-value {
    background: var(--accent);
    border-radius: 4px;
}

progress {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
}

progress::-webkit-progress-bar {
    background: var(--border);
    border-radius: 4px;
}

progress::-webkit-progress-value {
    background: var(--accent);
    border-radius: 4px;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

legend {
    padding: 0 0.5rem;
    font-weight: 500;
}

output {
    display: block;
    padding: 0.5rem 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    font-family: berkeley, monospace;
}

time {
    color: var(--text-muted);
    font-size: 0.875rem;
}

address {
    font-style: normal;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

[hidden] {
    display: none !important;
}

@media (max-width: 768px) {
    aside {
        transform: translateX(-100%);
        transition: transform 0.2s;
        z-index: 200;
    }

    aside[data-open] {
        transform: translateX(0);
    }

    body:has(aside) main,
    body:has(aside) header {
        margin-left: 0;
    }

    header nav button[data-menu] {
        display: flex;
    }

    main {
        padding: 1rem;
    }

    dl {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 769px) {
    header nav button[data-menu] {
        display: none;
    }
}

body[data-page="landing"] {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body[data-page="landing"] main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
}

body[data-page="landing"] main h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    max-width: 600px;
}

body[data-page="landing"] main p {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 500px;
    margin-bottom: 2rem;
}

body[data-page="landing"] main nav {
    display: flex;
    gap: 1rem;
}

body[data-page="landing"] main nav a {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
}

body[data-page="landing"] main nav a:first-child {
    background: var(--accent);
    color: white;
}

body[data-page="landing"] main nav a:first-child:hover {
    background: var(--accent-hover);
    text-decoration: none;
}

body[data-page="landing"] main nav a:last-child {
    background: var(--border);
    color: var(--text);
}

body[data-page="landing"] main nav a:last-child:hover {
    background: var(--text-muted);
    color: var(--bg);
    text-decoration: none;
}

body[data-page="landing"] section {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    text-align: left;
}

body[data-page="landing"] section article {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    height: 100%;
}

body[data-page="landing"] section article + article {
    margin-top: 0;
}

body[data-page="landing"] section article svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--accent);
}

body[data-page="landing"] section article h3 {
    font-size: 1rem;
    font-weight: 600;
}

body[data-page="landing"] section article p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

body[data-page="landing"] footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
}

body[data-page="auth"] {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

body[data-page="auth"] main {
    width: 100%;
    max-width: 400px;
    padding: 0;
}

body[data-page="auth"] article {
    padding: 2rem;
}

body[data-page="auth"] article > header {
    text-align: center;
    margin-bottom: 1.5rem;
    display: block;
}

body[data-page="auth"] article > header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem 0;
}

body[data-page="auth"] article > header p {
    color: var(--text-muted);
    margin: 0;
}

body[data-page="auth"] article header h1 svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--accent);
}


body[data-page="auth"] article footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

body[data-page="auth"] nav {
    position: fixed;
    top: 1rem;
    right: 1rem;
}
