:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --border: #d4d4d4;
    --border-strong: #a0a0a0;
    --text: #000000;
    --text-dim: #595959;
    --accent: #003399;
    --accent-hover: #0055cc;
    --accent-visited: #551a8b;
    --accent-tint: rgba(0, 51, 153, 0.06);
    --success: #006622;
    --error: #990000;
    --serif: Charter, 'Iowan Old Style', 'Sitka Text', Cambria, Georgia, 'Times New Roman', serif;
    --mono: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
}

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

body {
    font-family: var(--serif);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    font-size: 17px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}
a:visited { color: var(--accent-visited); }
a:hover { color: var(--accent-hover); }

code, pre, input, select, textarea, button, .mono {
    font-family: var(--mono);
}

h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.005em;
}

nav {
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 0;
}

.nav-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.logo {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    font-style: italic;
}

.nav-links { display: flex; gap: 1.25rem; }
.nav-links a {
    color: var(--accent);
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.nav-links a:visited { color: var(--accent); }
.nav-links a:hover { color: var(--accent-hover); }

main {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem;
    flex: 1;
    width: 100%;
}

footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}
footer a { color: var(--accent); }

/* Hero */
.hero {
    text-align: left;
    padding: 1.25rem 0 1rem;
}
.hero h1 {
    font-size: 1.9rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}
.subtitle {
    color: var(--text-dim);
    font-size: 1rem;
    margin: 0;
    font-style: italic;
}

/* Encrypt form */
.encrypt-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 1.75rem;
    margin-bottom: 2rem;
}

.form-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-step .step-num {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--text);
    font-family: var(--serif);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1rem;
}

.step-num-spacer {
    flex-shrink: 0;
    width: 1.75rem;
}

.step-body {
    flex: 1;
    min-width: 0;
}

.step-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--text);
}

.tz-hint {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-style: italic;
}

/* Time picks */
.time-picks {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.btn-pick {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    background: var(--bg);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 2px;
    cursor: pointer;
    font-family: var(--mono);
    transition: all 0.15s;
}
.btn-pick:hover {
    border-color: var(--text);
    color: var(--text);
}
.btn-pick.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-tint);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.65rem 1.2rem;
    border: 1px solid var(--text);
    border-radius: 2px;
    font-family: var(--mono);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.btn-full {
    display: block;
    width: 100%;
    text-align: center;
}
.btn-primary {
    background: var(--text);
    color: var(--bg);
    font-size: 0.95rem;
    padding: 0.75rem;
    border-color: var(--text);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-primary:disabled {
    background: var(--bg);
    cursor: not-allowed;
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text); }
.btn-small {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    background: var(--bg);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 2px;
    cursor: pointer;
    font-family: var(--mono);
}
.btn-small:hover { border-color: var(--text); color: var(--text); }

/* Forms */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text);
    font-size: 0.95rem;
}
.form-group input,
.form-group select,
.step-body input[type="datetime-local"] {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 0.7rem;
    border-radius: 2px;
    font-family: var(--mono);
    font-size: 0.9rem;
    width: 100%;
}
.form-group input:focus,
.step-body input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Drop zone */
.drop-zone {
    border: 1px dashed var(--border-strong);
    border-radius: 2px;
    padding: 2.25rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-tint);
}
.drop-zone-lg { padding: 3rem 1.5rem; }
.drop-zone p { color: var(--text-dim); font-size: 0.9rem; font-family: var(--serif); font-style: italic; }

.file-info {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 0.85rem;
    gap: 1rem;
}
.file-info[hidden] { display: none; }
.file-info:not([hidden]) { display: flex; }

/* Privacy note */
.privacy-note {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-top: 1rem;
    font-style: italic;
}

/* Status */
.status {
    margin-top: 1rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 0.9rem;
    font-family: var(--mono);
}
.status.info { color: var(--text-dim); }
.status.success { color: var(--success); border-color: var(--success); }
.status.error { color: var(--error); border-color: var(--error); }

/* Page headers */
.page-header {
    padding: 1.5rem 0 1.25rem;
}
.page-header h1 { margin-bottom: 0.4rem; font-size: 1.8rem; }
.page-header p { color: var(--text-dim); font-style: italic; }

/* Steps (how it works) */
.how-it-works { padding: 1.5rem 0; }
.how-it-works h2 { margin-bottom: 1.25rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; }
.step {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 1.25rem;
}
.step .step-num { margin-bottom: 0.6rem; }
.step h3 { margin-bottom: 0.4rem; font-size: 1.05rem; }
.step p { color: var(--text-dim); font-size: 0.95rem; }

/* Docs */
.examples {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    margin-bottom: 1.75rem;
}
.examples h2 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}
.examples ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 1rem;
}
.examples li {
    color: var(--text-dim);
    font-size: 0.95rem;
}
.examples strong { color: var(--text); }

.docs h2 {
    margin-top: 1.75rem;
    margin-bottom: 0.6rem;
    font-size: 1.2rem;
}
.docs pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 0.85rem 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}
.docs code {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text);
}
.docs ul,
.docs ol {
    padding-left: 1.5rem;
    color: var(--text);
}
.docs li { margin-bottom: 0.4rem; font-size: 0.95rem; }
.docs p { color: var(--text); font-size: 0.95rem; margin-bottom: 0.7rem; }
.format-list {
    display: grid;
    grid-template-columns: minmax(7rem, max-content) 1fr;
    gap: 0.45rem 1rem;
    margin: 0.75rem 0 0.9rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.format-list dt {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--text-dim);
}
.format-list dd {
    font-size: 0.95rem;
    margin: 0;
}
.format-note {
    color: var(--text-dim);
    font-style: italic;
}

@media (max-width: 560px) {
    .examples ul { grid-template-columns: 1fr; }
    .format-list { grid-template-columns: 1fr; gap: 0.15rem; }
    .format-list dd { margin-bottom: 0.45rem; }
}

/* Diagrams */
.diagram-svg {
    width: 100%;
    max-width: 800px;
    margin: 1rem 0 1.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 1rem;
}
.diagram-svg text {
    font-family: var(--mono);
}

.mt-half { margin-top: 0.5rem; }

/* CLI details (decrypt page) */
.cli-details {
    max-width: 720px;
    margin: 1.5rem auto 0;
    padding: 0 1.5rem;
}
.cli-details summary {
    color: var(--accent);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
    font-style: italic;
}
.cli-details summary:hover { color: var(--accent-hover); }

/* Unlock status (decrypt page) */
.unlock-status {
    padding: 0.6rem 0.75rem;
    border-radius: 2px;
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    font-family: var(--mono);
}
.unlock-status.locked { color: var(--text); border-color: var(--text); }
.unlock-status.unlocked { color: var(--success); border-color: var(--success); }

/* Success state */
.success-state { text-align: center; }
.success-msg {
    font-size: 1rem;
    color: var(--success);
    margin-bottom: 1.25rem;
    font-style: italic;
}
.btn-link {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--serif);
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.btn-link:hover { color: var(--accent-hover); }

/* Download */
#download { margin-top: 1rem; }

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
th, td {
    padding: 0.45rem 0.7rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    color: var(--text);
    font-weight: 700;
    border-bottom: 2px solid var(--text);
}
