/* Euklid — terminal-inspired theme. Styles target the custom tags in index.html. */

:root {
  --bg: #000000;
  --fg: #8fcf9f;          /* soft green */
  --fg-dim: #5c8a68;
  --fg-bright: #cdeed6;
  --error: #ff5f5f;
  --font-mono: "SF Mono", "Menlo", "Consolas", "DejaVu Sans Mono", "Courier New", monospace;
  --page-width: 52rem;
  --space: 1rem;
}

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

/* Static scale: a fixed root size so every rem-based size ignores the browser's default
   font size, and mobile browsers do not auto-inflate text. */
html {
  background: var(--bg);
  font-size: 13.5px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 var(--space) calc(var(--space) * 2);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.6;
}

/* Custom tags are inline by default; make them behave as blocks. */
navbar, navlogo, navitem, content-section, content-title, content-paragraph, contact-section {
  display: block;
}

/* ---- Navigation ---- */
navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: var(--space) 0;
  border-bottom: 1px dashed var(--fg-dim);
}

navlogo {
  font-weight: bold;
  font-size: 1.25rem;
}

navlogo { margin-right: auto; }
navitem { margin-left: calc(var(--space) * 1.5); }
navlogo a, navitem a { text-decoration: none; }
navitem a, navitem { cursor: pointer; }
navitem:hover { color: var(--fg-bright); }

/* ---- Sections ---- */
content-section, contact-section {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
}

/* About fills the space between nav and contact, centring its content vertically. */
content-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--space) * 3) 0;
}

contact-section { padding-top: calc(var(--space) * 2); }

content-title {
  margin-bottom: var(--space);
  font-size: 1.4rem;
  font-weight: bold;
}

content-paragraph { max-width: 70ch; }

b { color: var(--fg-bright); }

a {
  color: var(--fg-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover, a:focus-visible { background: var(--fg); color: var(--bg); }

/* ---- Contact form ---- */
form {
  display: grid;
  gap: var(--space);
  max-width: 36rem;
}

label {
  display: grid;
  gap: 0.25rem;
  color: var(--fg-dim);
}

input, textarea, select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--fg-dim);
  border-radius: 0;
  font: inherit;
  caret-color: var(--fg);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--fg);
  box-shadow: 0 0 0 1px var(--fg);
}
input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 0;
  font: inherit;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--fg); color: var(--bg); }
textarea { min-height: 8rem; resize: vertical; }

button {
  justify-self: start;
  padding: 0.5rem 1.25rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 0;
  font: inherit;
  cursor: pointer;
}
button:hover:not(:disabled), button:focus-visible { background: var(--fg); color: var(--bg); }
button:disabled { opacity: 0.5; cursor: wait; }

/* Honeypot field: hidden from people, visible to bots. */
.hp-field { position: absolute; left: -9999px; }

.form-status { min-height: 1.6em; margin: 0; }
.form-status.is-error { color: var(--error); }

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