:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --fg: #f0f0f0;
  --fg-dim: rgba(240, 240, 240, 0.55);
  --fg-hover: #ffffff;
  --line: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.16);
  --footer: rgba(255, 255, 255, 0.22);
  --switch-track: rgba(255, 255, 255, 0.1);
  --switch-track-border: rgba(255, 255, 255, 0.28);
  --switch-ring: #f0f0f0;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #0a0a0a;
  --fg-dim: rgba(10, 10, 10, 0.55);
  --fg-hover: #000000;
  --line: rgba(0, 0, 0, 0.1);
  --border: rgba(0, 0, 0, 0.14);
  --footer: rgba(0, 0, 0, 0.28);
  --switch-track: rgba(0, 0, 0, 0.06);
  --switch-track-border: rgba(0, 0, 0, 0.22);
  --switch-ring: #0a0a0a;
}

:root {
  --font: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --page-w: clamp(17.5rem, 36vw, 40rem);
  --pad-x: clamp(1rem, 3vw, 2rem);
  --pad-y: clamp(1rem, 2.5vh, 2rem);
  --space-sm: clamp(0.5rem, 1.2vh, 0.75rem);
  --space-md: clamp(0.75rem, 1.8vh, 1.25rem);
  --space-lg: clamp(1.25rem, 3vh, 2rem);

  --logo-size: clamp(3.25rem, 4vw + 1.5rem, 5rem);
  --text-base: clamp(0.8rem, 0.35vw + 0.72rem, 0.95rem);
  --text-sm: clamp(0.72rem, 0.25vw + 0.65rem, 0.84rem);
  --text-lg: clamp(1rem, 0.6vw + 0.85rem, 1.35rem);
  --leading: 1.4;
}

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

html {
  font-size: clamp(15px, 0.25vw + 14px, 17px);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--fg);
  font-family: var(--font);
  background: var(--bg);
  line-height: var(--leading);
  transition: background 0.2s ease, color 0.2s ease;
}

.theme-switch {
  position: fixed;
  top: clamp(0.65rem, 2vh, 1.25rem);
  right: clamp(0.65rem, 2vw, 1.25rem);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: clamp(0.55rem, 1.4vw, 0.75rem);
  padding: clamp(0.45rem, 1vh, 0.55rem) clamp(0.55rem, 1.2vw, 0.7rem);
  border: 1px solid var(--switch-track-border);
  background: var(--switch-track);
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(127, 127, 127, 0.08),
    0 4px 14px rgba(0, 0, 0, 0.12);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .theme-switch {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 4px 18px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .theme-switch {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 4px 14px rgba(0, 0, 0, 0.08);
}

.theme-switch__btn {
  margin: 0;
  padding: 2px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
  transition: transform 0.15s ease;
}

.theme-switch__btn:hover {
  transform: scale(1.06);
}

.theme-switch__dot {
  display: block;
  width: clamp(0.95rem, 1.6vw + 0.55rem, 1.2rem);
  height: clamp(0.95rem, 1.6vw + 0.55rem, 1.2rem);
  border-radius: 50%;
  border: 1px solid transparent;
  transition:
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.theme-switch__dot--light {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.18);
}

.theme-switch__dot--dark {
  background: #000000;
  border-color: rgba(255, 255, 255, 0.22);
}

.theme-switch__btn.is-active .theme-switch__dot {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 3px var(--switch-ring);
  transform: scale(1.08);
}

.theme-switch__btn:focus-visible {
  outline: none;
}

.theme-switch__btn:focus-visible .theme-switch__dot {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 3px var(--switch-ring),
    0 0 0 5px var(--border);
}

.page {
  position: relative;
  width: var(--page-w);
  max-width: 100%;
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x) var(--space-lg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--line);
}

.logo-wrap {
  width: var(--logo-size);
  height: var(--logo-size);
  margin-bottom: var(--space-sm);
  display: grid;
  place-items: center;
}

.logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand {
  margin: 0 0 var(--space-sm);
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--fg);
}

.heading {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: var(--leading);
  max-width: 22em;
}

.projects-section {
  margin: 0;
}

.section-label {
  margin: 0 0 var(--space-sm);
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.project {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--line);
}

.project:hover .project-title {
  color: var(--fg-hover);
}

.project-title {
  margin: 0 0 0.35em;
  font-size: var(--text-base);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: var(--leading);
  transition: color 0.15s ease;
}

.project-line {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--fg-dim);
  line-height: var(--leading);
}

.contact-section {
  margin: var(--space-md) 0 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--line);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}

.contact-field__label {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
}

.contact-input {
  width: 100%;
  margin: 0;
  padding: 0.55em 0.65em;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: 300;
  line-height: var(--leading);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.contact-input::placeholder {
  color: var(--fg-dim);
  opacity: 0.75;
}

.contact-input:focus {
  outline: none;
  border-color: var(--border);
}

.contact-input--area {
  resize: vertical;
  min-height: 5.5em;
  max-height: 16em;
}

.contact-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-submit {
  align-self: flex-start;
  margin: 0.15em 0 0;
  padding: 0.5em 1.1em;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.contact-submit:hover:not(:disabled) {
  border-color: var(--border);
  color: var(--fg-hover);
}

.contact-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.contact-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--border);
}

.contact-status {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--fg-dim);
}

.contact-status.is-success {
  color: var(--fg);
}

.contact-status.is-error {
  color: var(--fg);
}

.footer {
  margin: var(--space-md) 0 0;
  text-align: center;
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--footer);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.2em;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--fg-hover);
}

@media (max-width: 480px) {
  .page {
    justify-content: flex-start;
    padding-top: clamp(2.25rem, 8vh, 3rem);
  }
}

@media (min-width: 1600px) {
  :root {
    --page-w: clamp(22rem, 32vw, 44rem);
  }
}
