/* =============================================================
   Personal site stylesheet — minimal monospace, dotted leaders.
   Inspired by pucek.capital. Light/dark via prefers-color-scheme.
   ============================================================= */

/* ---------- Fonts -----------------------------------------------
   Berkeley Mono is the original; it's a paid font. If you own a
   license, drop the .woff2 files into /fonts and uncomment the
   @font-face rules below. Otherwise the stack falls back through
   common system + free monospace faces.
   --------------------------------------------------------------- */

/*
@font-face {
  font-family: "Berkeley Mono";
  src: url("/fonts/BerkeleyMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Berkeley Mono";
  src: url("/fonts/BerkeleyMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
*/

/* ---------- Theme tokens --------------------------------------- */
:root {
  --color-bg: #ffffff;
  --color-text: #000000;
  --color-rule: #000000;
  --color-muted: #666666;

  --font-mono: "Berkeley Mono", "JetBrains Mono", "SF Mono",
               "Cascadia Code", "Fira Code", ui-monospace,
               Menlo, Consolas, monospace;

  --max-width: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a18;
    --color-surface: #252520;
    --color-surface-raised: #2e2e28;
    --color-text: #e8e0d0;
    --color-rule: #e8e0d0;
    --color-muted: #8a8070;
    --color-accent: #c96a3c;
    --color-accent-amber: #d4922a;
    --color-accent-sand: #c8a97a;
    --color-accent-ochre: #a89050;
    --color-destructive: #c0392b;
  }
}

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

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-mono);
  background: var(--color-bg);
  color: var(--color-text);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Typography ----------------------------------------- */
h1,
h2 {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 0.5rem;
}

a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration: none;
}

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

::selection {
  background: var(--color-text);
  color: var(--color-bg);
}

.muted {
  color: var(--color-muted);
}

.muted a {
  color: var(--color-muted);
}

/* ---------- Header / nav --------------------------------------- */
.tagline {
  margin: 0.75rem 0 1rem;
  line-height: 1.5;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
  color: var(--color-muted);
}

.header-links a,
.header-links .sep {
  color: var(--color-muted);
}

/* ---------- Dotted-leader entry rows --------------------------- */
/* Use this for rows that look like:
     LABEL . . . . . . . . . . . . . . . . . . . . VALUE          */
.entry {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.entry-label {
  white-space: nowrap;
  text-transform: uppercase;
  flex-shrink: 0;
}

.entry-dots {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  color: var(--color-muted);
}

.entry-dots::before {
  /* Long string of " . " — flex container clips overflow so the
     dots fill the gap regardless of label/value length. */
  content: " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ";
}

.entry-value {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Lists ---------------------------------------------- */
.directory-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0 1rem;
}

.directory-list li {
  margin-bottom: 0.125rem;
}

/* ---------- Two-column layout ---------------------------------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---------- Forms ---------------------------------------------- */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

input,
textarea,
select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 0.5rem;
  border: 1px solid var(--color-text);
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 2rem;
}

@media (prefers-color-scheme: dark) {
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  }
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-muted);
}

button[type="submit"] {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem;
  border: none;
  border-radius: 0;
  background: var(--color-text);
  color: var(--color-bg);
  cursor: pointer;
}

button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-status {
  margin-top: 1rem;
  padding: 0.75rem;
  font-size: 14px;
  border: 1px solid var(--color-text);
}

/* ---------- Footer --------------------------------------------- */
footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-rule);
  font-size: 0.85rem;
  color: var(--color-muted);
}

footer a {
  color: var(--color-muted);
}

/* ---------- Responsive ----------------------------------------- */
@media (max-width: 480px) {
  .two-col {
    grid-template-columns: 1fr;
  }
  .entry {
    flex-wrap: wrap;
  }
  .entry-dots {
    display: none;
  }
  .entry-value {
    white-space: normal;
    width: 100%;
    padding-left: 1rem;
  }
}
