/* ==========================================================================
   IMG DEV. — site styles
   Dark, terminal-inspired. Light mode available via [data-theme="light"].
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */

:root {
  --bg: #0b0e12;
  --bg-elev: #11151b;
  --surface: #12171e;
  --border: #212933;
  --border-strong: #2f3946;
  --text: #dbe2ea;
  --text-dim: #98a4b2;
  --text-faint: #6a7481;
  --accent: #4ade80;
  --accent-strong: #86efac;
  --accent-glow: rgba(74, 222, 128, 0.13);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --maxw: 1080px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.28);

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fbfcfd;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --border: #e3e9ef;
  --border-strong: #c9d2dc;
  --text: #101519;
  --text-dim: #55606d;
  --text-faint: #7b8693;
  --accent: #0b8a4d;
  --accent-strong: #076f3c;
  --accent-glow: rgba(11, 138, 77, 0.1);
  --shadow: 0 1px 2px rgba(16, 21, 25, 0.06), 0 10px 30px rgba(16, 21, 25, 0.07);

  color-scheme: light;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(
    ellipse 80% 55% at 50% -10%,
    var(--accent-glow),
    transparent 70%
  );
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand__sigil {
  color: var(--accent);
  font-weight: 700;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.site-nav a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  margin-left: 0.35rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--border-strong);
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
}

:root:not([data-theme="light"]) .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn--primary {
  background: var(--accent);
  color: #06120b;
  border-color: var(--accent);
}

:root[data-theme="light"] .btn--primary {
  color: #ffffff;
}

.btn--primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  border-top: 1px solid var(--border);
}

.section__label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.section__title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin-bottom: 0.75rem;
}

.section__lead {
  color: var(--text-dim);
  max-width: 58ch;
  margin-bottom: 2.5rem;
}

/* Sections with no lead paragraph still need breathing room below the title. */
.section__title + .app-grid,
.section__title + .contact-grid {
  margin-top: 2.5rem;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 3.5rem);
  align-items: center;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.05fr 1fr;
  }
}

.hero__title {
  font-size: clamp(2rem, 5.5vw, 3.15rem);
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.hero__title .accent {
  color: var(--accent);
}

.hero__lead {
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  color: var(--text-dim);
  max-width: 46ch;
  margin-bottom: 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   Terminal window
   -------------------------------------------------------------------------- */

.terminal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.terminal__dots {
  display: flex;
  gap: 0.4rem;
}

.terminal__dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.terminal__title {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.terminal__body {
  padding: 1.25rem 1.15rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.85;
  overflow-x: auto;
}

.terminal__body p {
  margin: 0;
  white-space: pre-wrap;
}

.terminal__body .cmd {
  color: var(--text);
}

.terminal__body .cmd::before {
  content: "$ ";
  color: var(--accent);
}

.terminal__body .out {
  color: var(--text-dim);
}

.terminal__body .comment {
  color: var(--text-faint);
}

.terminal__body .spacer {
  height: 0.9rem;
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .cursor {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   App library
   -------------------------------------------------------------------------- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.app-card__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1.1rem;
}

.app-card__title {
  font-size: 1.05rem;
}

.app-card__desc {
  color: var(--text-dim);
  font-size: 0.925rem;
  margin: 0;
  flex-grow: 1;
}

.app-card__link {
  font-family: var(--mono);
  font-size: 0.82rem;
  text-decoration: none;
  align-self: flex-start;
}

.app-card__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
}

.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.app-note {
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

@media (min-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr 1.15fr;
  }
}

.contact-aside p {
  color: var(--text-dim);
  max-width: 42ch;
}

.contact-aside__email {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.95rem;
  margin-top: 0.5rem;
  word-break: break-all;
}

.form {
  display: grid;
  gap: 1.1rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea {
  resize: vertical;
  min-height: 8rem;
  line-height: 1.6;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-faint);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}

.form__note {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin: 0;
}

.form__status {
  font-family: var(--mono);
  font-size: 0.83rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
}

.form__status[hidden] {
  display: none;
}

.form__status--ok {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-glow);
}

.form__status--error {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.08);
}

:root[data-theme="light"] .form__status--error {
  color: #b91c1c;
}

/* Honeypot — hidden from humans, visible to naive bots. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding-block: 3rem 2rem;
  margin-top: auto;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer__tagline {
  color: var(--text-dim);
  font-size: 0.9rem;
  max-width: 34ch;
  margin: 0.75rem 0 0;
}

.footer-col h3 {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.9rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--accent);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   Legal pages
   -------------------------------------------------------------------------- */

.legal {
  padding-block: clamp(3rem, 7vw, 4.5rem);
}

.legal__inner {
  max-width: 46rem;
  margin-inline: auto;
}

.legal__title {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  margin-bottom: 0.6rem;
}

.legal__meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 2rem;
}

.legal__intro {
  color: var(--text-dim);
  font-size: 1.02rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.legal__toc {
  margin: 2rem 0 3rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.legal__toc h2 {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.9rem;
}

.legal__toc ol {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.legal__toc a {
  text-decoration: none;
  color: var(--text-dim);
}

.legal__toc a:hover {
  color: var(--accent);
}

.legal section {
  margin-bottom: 2.5rem;
}

.legal h2 {
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
  padding-top: 0.5rem;
}

.legal h2 .num {
  color: var(--accent);
  margin-right: 0.5rem;
}

.legal h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin: 1.5rem 0 0.6rem;
}

.legal p,
.legal li {
  color: var(--text-dim);
}

.legal ul {
  padding-left: 1.15rem;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.45rem;
}

.legal li::marker {
  color: var(--text-faint);
}
