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

:root {
    --bg: #fafafa;
    --fg: #111;
    --muted: #888;
    --accent: #111;
    --border: #e5e5e5;
    --max-width: 720px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Nav */
nav {
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

nav .wordmark {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--fg);
}

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

nav ul a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.9rem;
    transition: color 0.15s;
}

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

/* Main */
main {
    flex: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
}

/* Page-specific */
.home-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.home-subtitle {
    font-size: 1.1rem;
    color: var(--muted);
    line-height: 1.6;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.page-subtitle {
    color: var(--muted);
    line-height: 1.6;
}

/* Deed Search */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
    outline: none;
    transition: border-color 0.15s;
}

.search-input:focus { border-color: var(--fg); }

.search-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--fg);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.search-btn:hover { opacity: 0.75; }

.results-count {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.no-results {
    color: var(--muted);
    margin-top: 1rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-card {
    display: block;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
}

.result-card:hover { border-color: var(--fg); }

.result-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
}

.result-type {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.result-date { font-size: 0.85rem; color: var(--muted); }

.result-parties {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.party-role { color: var(--muted); font-size: 0.85rem; }

.result-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--muted);
}

.result-price { font-weight: 500; color: var(--fg); }

/* Document detail */
.back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.back-link:hover { color: var(--fg); }

.detail-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem 1rem;
    margin: 1.5rem 0 2rem;
    font-size: 0.9rem;
}

.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; }

.section-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.detail-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.detail-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

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

.role-cell { text-transform: capitalize; }
.muted { color: var(--muted); }
.mono { font-family: monospace; font-size: 0.8rem; }

@media (max-width: 640px) {
    nav { padding: 0 1.25rem; gap: 1rem; }
    nav .wordmark { white-space: nowrap; flex-shrink: 0; }
    nav ul { gap: 1.15rem; overflow-x: auto; scrollbar-width: none; }
    nav ul::-webkit-scrollbar { display: none; }
    nav ul a { white-space: nowrap; }
}

@media (max-width: 480px) {
    main { padding: 2.5rem 1.25rem; }
    .search-form { flex-direction: column; }
    .detail-grid { grid-template-columns: 100px 1fr; }
}
