/* The whole site's styles. Colours follow the visitor's light or dark setting. */

:root {
  color-scheme: light dark;
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #57534e;
  --border: #e7e5e4;
  --accent: #0e7490;
  --accent-strong: #155e75;
  --tag-bg: #f5f5f4;
  --badge-bg: #fef3c7;
  --badge-text: #92400e;
  --on-accent: #ffffff;
  --danger: #b42318;
  --avatar: linear-gradient(135deg, #0e7490, #4338ca);
  --shadow: 0 1px 2px rgb(28 25 23 / 0.04), 0 10px 24px -14px rgb(28 25 23 / 0.18);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09;
    --surface: #1c1917;
    --text: #f5f5f4;
    --muted: #a8a29e;
    --border: #2f2a27;
    --accent: #67e8f9;
    --accent-strong: #a5f3fc;
    --tag-bg: #292524;
    --badge-bg: #422006;
    --badge-text: #fcd34d;
    --on-accent: #0c0a09;
    --danger: #fda29b;
    --shadow: none;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

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

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  z-index: 1;
}

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

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 6rem) 1.5rem 2.5rem;
}

/* Photo, name, role and profile links */

/* The padding shows the gradient background as a thin ring around the photo, so its black background stands out
   in dark mode too. */
.avatar {
  display: block;
  width: 7rem;
  height: 7rem;
  margin-bottom: 1.75rem;
  padding: 3px;
  border-radius: 50%;
  background: var(--avatar);
  object-fit: cover;
  box-shadow: var(--shadow);
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.role {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1.125rem;
}

.dot {
  margin: 0 0.25rem;
}

.profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-weight: 550;
  font-size: 0.9375rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

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

/* The one thing to do on a page: filled with the accent colour. */
.button-primary,
.button-primary:hover {
  color: var(--on-accent);
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
}

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

/* Sections */

.section {
  margin-top: clamp(3rem, 9vw, 4.5rem);
}

h2 {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section > p {
  margin: 0 0 1rem;
  max-width: 65ch;
}

/* Project cards: the whole card is the link to the project */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.project {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.375rem 1.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.project:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.625rem;
  margin: 0 0 0.5rem;
  font-size: 1.1875rem;
  line-height: 1.3;
}

.project h3 a {
  color: inherit;
  text-decoration: none;
}

.project h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.project h3 a:focus-visible {
  outline: none;
}

.project:has(h3 a:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.badge {
  padding: 0.125rem 0.55rem;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: auto 0 0;
  padding: 1.125rem 0 0;
  list-style: none;
}

.tags li {
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--muted);
  font-size: 0.8125rem;
}

.project .url {
  margin-top: 0.875rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 550;
  overflow-wrap: anywhere;
}

.url svg {
  vertical-align: -0.125em;
}

/* Footer */

.footer {
  margin-top: clamp(3.5rem, 10vw, 5.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer p {
  margin: 0;
}

/* The contact page */

.back {
  margin: 0 0 clamp(2rem, 6vw, 3rem);
  font-size: 0.9375rem;
}

.back a {
  color: var(--muted);
  text-decoration: none;
}

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

.lede {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1.125rem;
}

.form {
  display: grid;
  gap: 1.25rem;
  max-width: 34rem;
  margin-top: 2rem;
}

.field label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--accent);
  outline-offset: 1px;
}

/* Marked only once the visitor has been in the field, or tried to send. */
.field input:user-invalid,
.field textarea:user-invalid {
  border-color: var(--danger);
}

.hint {
  margin: 0.375rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

/* A field only bots fill in: the API drops messages that have it. */
.trap {
  display: none;
}

.form .button {
  justify-self: start;
  padding: 0.625rem 1.375rem;
  font-size: 1rem;
}

.aside {
  margin: 2rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* The "page not found", "message sent" and "message not sent" pages */

.notice {
  padding-top: clamp(2rem, 8vw, 5rem);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.notice > p:not(.eyebrow) {
  margin: 1rem 0 0;
  color: var(--muted);
  max-width: 65ch;
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .project {
    transition: none;
  }

  .project:hover {
    transform: none;
  }
}
