@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --background: #080d12;
  --surface: rgba(17, 25, 32, 0.94);
  --surface-light: #18232b;
  --text: #f1f4f2;
  --muted: #9aa8ad;
  --accent: #f26b21;
  --accent-light: #ff9b55;
  --border: #33434a;
  --grid: rgba(143, 169, 175, 0.07);
}

[data-theme="light"] {
  --background: #f3f5f4;
  --surface: rgb(255 255 255 / 92%);
  --surface-light: #e8eeec;
  --text: #172126;
  --muted: #53656b;
  --accent: #c95010;
  --accent-light: #a53f0b;
  --border: #b7c5c5;
  --grid: rgba(54, 78, 84, 0.1);
}

section.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

* {
  box-sizing: border-box;
}

.back_to_top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9;
  padding: 10px 14px;
  color: #111820;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.back_to_top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back_to_top:hover {
  background: var(--accent-light);
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    radial-gradient(circle at 50% -20%, #24353c 0, var(--background) 52%);
  background-size: 42px 42px, 42px 42px, auto;
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
}

[data-theme="light"] body {
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    radial-gradient(circle at 50% -20%, #ffffff 0, var(--background) 52%);
  background-size: 42px 42px, 42px 42px, auto;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: linear-gradient(115deg, transparent 49.8%, rgb(242 107 33 / 12%) 50%, transparent 50.2%);
  background-size: 180px 180px;
  content: "";
  pointer-events: none;
}

header {
  position: relative;
  overflow: hidden;
  padding: 88px 20px 72px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgb(15 24 30 / 97%), rgb(8 13 18 / 92%));
}

[data-theme="light"] header {
  background: linear-gradient(135deg, rgb(255 255 255 / 97%), rgb(231 238 236 / 92%));
}

header h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 0.95;
  text-transform: uppercase;
}

header p {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero_actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.primary_button,
.secondary_button,
.contact_links a {
  display: inline-block;
  padding: 11px 18px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  font-weight: 700;
  text-decoration: none;
  transition: 0.2s ease;
}

.primary_button,
.contact_links a {
  color: #111820;
  background: var(--accent);
}

.secondary_button {
  color: var(--text);
  background: transparent;
}

.primary_button:hover,
.contact_links a:hover {
  border-color: var(--accent-light);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.secondary_button:hover {
  color: #111820;
  background: var(--accent);
  transform: translateY(-2px);
}

.nav_bar {
  position: sticky;
  z-index: 10;
  top: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgb(8 13 18 / 92%);
  backdrop-filter: blur(14px);
}

[data-theme="light"] .nav_bar {
  background: rgb(243 245 244 / 92%);
}

.nav_bar ul {
  display: flex;
  justify-content: center;
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 0;
  list-style: none;
  flex-wrap: wrap;
}

.nav_bar a {
  color: var(--muted);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

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

.nav_bar a.active {
  color: var(--accent);
}

.theme_toggle {
  position: absolute;
  right: 20px;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(110px, 11vw, 120px);
  min-height: 32px;
  padding: 5px 26px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-light);
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transform: translateY(-50%);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease,
    box-shadow 0.2s ease, transform 0.2s ease;
}

.theme_toggle::before {
  position: absolute;
  left: 4px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  content: "☀";
  font-size: 0.95rem;
  line-height: 1;
  transition: left 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.theme_toggle[aria-pressed="true"]::before {
  left: calc(100% - 24px);
  content: "☾";
}

.theme_toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--surface-light);
  box-shadow: 0 6px 18px rgb(0 0 0 / 18%);
  transform: translateY(calc(-50% - 1px));
}

.theme_toggle:active {
  transform: translateY(-50%);
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 20px;
}

section {
  position: relative;
  margin-bottom: 42px;
  padding: clamp(28px, 5vw, 52px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgb(0 0 0 / 18%);
  scroll-margin-top: 80px;
}

section::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 90px;
  height: 3px;
  background: var(--accent);
  content: "";
}

section::after {
  position: absolute;
  right: 18px;
  top: 18px;
  color: var(--border);
  content: "//";
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.2em;
}

section h2 {
  margin: 0 0 22px;
  color: var(--text);
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

section h2::before {
  margin-right: 10px;
  color: var(--accent);
  content: "■";
  font-size: 0.55em;
  vertical-align: middle;
}

section h3 {
  margin: 18px 0 8px;
  color: var(--accent-light);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

section p {
  max-width: 780px;
  color: #d5dcda;
  margin: 0 0 18px;
}

[data-theme="light"] section p,
[data-theme="light"] section ul {
  color: #32474d;
}

.contact_form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 780px;
  margin: 28px auto 0;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--border);
  background: rgb(8 13 18 / 45%);
}

#contact {
  text-align: center;
}

#contact > p {
  margin-inline: auto;
}

.contact_form .form_error {
  grid-column: 1 / -1;
  margin: 0;
  color: #ff8a8a;
  text-align: left;
}

.contact_form div {
  display: grid;
  gap: 7px;
  text-align: left;
}

.contact_form .form_message {
  grid-column: 1 / -1;
}

.contact_form .form_subject {
  grid-column: 1 / -1;
}

.contact_form .form_trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.contact_form label {
  color: var(--accent-light);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact_form input,
.contact_form textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 2px;
  outline: 0;
  background: var(--surface-light);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact_form textarea {
  min-height: 140px;
  resize: vertical;
}

.contact_form input:focus,
.contact_form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(242 107 33 / 15%);
}

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

.contact_form input[aria-invalid="true"],
.contact_form textarea[aria-invalid="true"] {
  border-color: #e05252;
}

.field_error {
  margin: 0;
  color: #ff8a8a;
  font-size: 0.85rem;
}

.contact_form button {
  grid-column: 1 / -1;
  justify-self: center;
  padding: 11px 18px;
  color: #111820;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: 0.2s ease;
}

.contact_form button:hover {
  border-color: var(--accent-light);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.contact_form button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.form_status {
  grid-column: 1 / -1;
  margin: 0;
  padding: 13px 16px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface-light);
  text-align: center;
}

.form_status.success {
  border-color: var(--accent);
  color: var(--accent-light);
}

.form_status.error {
  border-color: #e05252;
  color: #ff8a8a;
}

.form_result {
  min-height: 100vh;
  display: grid;
  place-items: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px;
}

.form_result section {
  width: min(100%, 680px);
  margin: 0;
}

section ul {
  padding-left: 20px;
  color: #d5dcda;
}

section li {
  margin-bottom: 9px;
}

.projets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 0;
  list-style: none;
}

.projets li {
  width: auto;
  padding: 16px;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface-light);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.projets li:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
}

.projets li.is-hovered {
  border-color: var(--accent);
  transform: translateY(-5px);
}

.projets img {
  width: 100%;
  height: 150px;
  margin-bottom: 12px;
  border-radius: 1px;
  object-fit: cover;
}

.projets p {
  color: var(--muted);
  font-size: 0.92rem;
}

.project_tech {
  color: var(--accent-light) !important;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project_links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.projets a {
  color: var(--accent-light);
  font-weight: 700;
}

.contact_links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

a:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 4px;
}

button:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 4px;
}

footer {
  padding: 28px 20px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
  background: #080d12;
}

[data-theme="light"] footer {
  background: #e8eeec;
}

footer p {
  margin: 0;
}

@media (max-width: 600px) {
  header {
    padding: 64px 16px 52px;
  }

  .nav_bar ul {
    justify-content: center;
    gap: 12px 18px;
  }

  main {
    padding: 32px 16px;
  }

  section {
    margin-bottom: 24px;
  }

  .contact_form {
    grid-template-columns: 1fr;
  }

  .contact_form .form_message {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .nav_bar {
    display: block;
    padding: 0 16px 12px;
  }

  .nav_bar ul {
    width: 100%;
    justify-content: center;
    padding: 14px 0 8px;
  }

  .theme_toggle {
    position: relative;
    right: auto;
    top: auto;
    display: flex;
    width: min(100%, 180px);
    min-height: 36px;
    margin: 0 auto;
    transform: none;
  }

  .theme_toggle:hover {
    transform: translateY(-1px);
  }

  .theme_toggle:active {
    transform: none;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  section.reveal {
    opacity: 1;
    transform: none;
  }
}
