/*
  styles.css — Alex Carpenter freelance site.

  Mobile-first. Cool off-white page, near-black ink, one cobalt accent.
  System font stack (no web fonts to download), with a monospace face for
  the small section labels.
*/

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #11151c;
  --muted: #4f5766;
  --line: #dfe3ea;
  --accent: #2446d6;
  --accent-hover: #1a36ad;
  --accent-soft: #e6ebfc;
  --dark: #11151c;
  --on-dark: #e9ecf2;
  --on-dark-muted: #aab2c0;
  --radius: 12px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(247 248 250 / 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: 700 13px/1 var(--mono);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 15px;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:not(.nav-cta) {
  display: none;
}

.nav-links a:not(.nav-cta):hover {
  color: var(--accent);
}

.nav-cta {
  padding: 8px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-weight: 600;
}

.nav-cta:hover {
  background: var(--ink);
  color: #fff;
}

/* ---------- Buttons and links ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  font: 600 16px/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
}

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

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

.button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.text-link {
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.text-link:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

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

.hero {
  padding: 64px 0 72px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 85% 10%, var(--accent-soft), transparent 45%),
    var(--bg);
}

.hero-inner {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 13px/1.4 var(--mono);
  color: var(--muted);
  margin-bottom: 24px;
}

.dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

h1 {
  font-size: clamp(38px, 9vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin-bottom: 24px;
  text-wrap: balance;
}

h1 em {
  font-style: normal;
  color: var(--accent);
}

.lead {
  font-size: clamp(18px, 2.4vw, 21px);
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 32px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

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

.section {
  padding: 72px 0;
}

.label {
  font: 600 13px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

h2 {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 40px;
  text-wrap: balance;
}

h3 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

/* ---------- Work ---------- */

.project {
  display: grid;
  gap: 24px;
  margin-bottom: 56px;
}

.project:last-child {
  margin-bottom: 0;
}

.shot {
  display: block;
  text-decoration: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(17 21 28 / 0.04), 0 18px 40px -18px rgb(17 21 28 / 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shot:hover {
  transform: translateY(-3px);
  box-shadow: 0 1px 2px rgb(17 21 28 / 0.04), 0 26px 50px -20px rgb(17 21 28 / 0.32);
}

.shot-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #f1f3f6;
}

.shot-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cfd4dc;
}

.shot-bar em {
  margin-left: 10px;
  font: 12px/1 var(--mono);
  font-style: normal;
  color: var(--muted);
}

.project-type {
  font: 500 13px/1.4 var(--mono);
  color: var(--muted);
  margin-bottom: 8px;
}

.project-text h3 {
  font-size: 28px;
  margin-bottom: 14px;
}

.project-text p:not(.project-type) {
  color: var(--muted);
  margin-bottom: 14px;
  max-width: 480px;
}

.project-text .text-link {
  display: inline-block;
  margin-top: 4px;
}

/* ---------- Services ---------- */

.services {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.service-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.service-grid li {
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.num {
  display: block;
  font: 600 13px/1 var(--mono);
  color: var(--accent);
  margin-bottom: 18px;
}

.service-grid h3 {
  margin-bottom: 10px;
}

.service-grid p {
  color: var(--muted);
  font-size: 16px;
}

/* ---------- About ---------- */

.about-inner h2 {
  margin-bottom: 24px;
}

.about-text p {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 18px;
  max-width: 620px;
}

.about-text p:first-child {
  color: var(--ink);
}

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

.contact {
  background: var(--dark);
  color: var(--on-dark);
}

.contact .label {
  color: #9db0ff;
}

.contact h2 {
  color: #fff;
  margin-bottom: 18px;
}

.contact-inner {
  display: grid;
  gap: 40px;
}

.contact-intro > p {
  color: var(--on-dark-muted);
  margin-bottom: 20px;
  max-width: 440px;
}

.contact-intro .direct {
  color: var(--on-dark);
}

.contact-intro .direct a {
  font-weight: 600;
  color: #fff;
  text-decoration-color: #9db0ff;
  text-underline-offset: 4px;
}

.contact-form {
  display: grid;
  gap: 18px;
  padding: 24px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-size: 15px;
  font-weight: 600;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  font: 16px/1.4 var(--sans); /* 16px keeps iOS Safari from zooming on focus */
  color: var(--ink);
  background: var(--bg);
  border: 1px solid #c5cbd5;
  border-radius: 8px;
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

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

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

.form-status {
  min-height: 1.5em;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
}

.form-status[data-state="success"] {
  color: #17703f;
}

.form-status[data-state="error"] {
  color: #b42f21;
}

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

.site-footer {
  padding: 28px 0;
  font-size: 14px;
  color: var(--muted);
}

.footer-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer a {
  text-underline-offset: 3px;
}

/* ---------- Focus and skip link ---------- */

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.contact a:focus-visible {
  outline-color: #9db0ff;
}

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 10px;
  z-index: 50;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
}

/* ---------- Larger screens ---------- */

@media (min-width: 640px) {
  .wrap {
    padding: 0 32px;
  }

  .nav-links a:not(.nav-cta) {
    display: inline;
  }

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

  .contact-form {
    grid-template-columns: 1fr 1fr;
    padding: 32px;
  }

  .field.full {
    grid-column: 1 / -1;
  }

  .contact-form .button {
    align-self: flex-start;
  }

  .footer-row {
    flex-direction: row;
    justify-content: space-between;
    gap: 24px;
  }
}

@media (min-width: 860px) {
  .nav {
    height: 72px;
  }

  .hero {
    padding: 112px 0 120px;
  }

  .section {
    padding: 104px 0;
  }

  .project {
    grid-template-columns: 1.35fr 1fr;
    align-items: center;
    gap: 56px;
    margin-bottom: 88px;
  }

  .project:nth-of-type(even) {
    grid-template-columns: 1fr 1.35fr;
  }

  .project:nth-of-type(even) > .shot,
  .project:nth-of-type(even) > .media {
    order: 2;
  }

  .about-inner {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 64px;
  }

  .contact-inner {
    grid-template-columns: 1fr 1.3fr;
    gap: 64px;
    align-items: start;
  }
}

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

  .shot,
  .shot:hover {
    transition: none;
    transform: none;
  }
}

/* ---------- Featured projects (Puberty Parkour, Kairodo): wide shot + phone ---------- */

.media {
  position: relative;
  padding: 0 0 28px;
}

.phone {
  position: absolute;
  right: 10px;
  bottom: 0;
  width: 30%;
  max-width: 200px;
  overflow: hidden;
  border: 6px solid var(--ink);
  border-radius: 22px;
  background: var(--ink);
  box-shadow: 0 24px 48px -18px rgb(17 21 28 / 0.45);
}

.phone img {
  border-radius: 15px;
}

.badge {
  display: inline-block;
  margin-right: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #dff3e6;
  color: #17703f;
  font: 600 12px/1.6 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.badge-beta {
  background: #fff1d6;
  color: #8a5a00;
}

.features {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 480px;
  font-size: 16px;
}

.features li {
  position: relative;
  padding-left: 22px;
  color: var(--ink);
}

.features li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---------- Founder ---------- */

.founder {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--muted);
}

.founder strong {
  color: var(--ink);
}

.founder-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font: 700 15px/1 var(--mono);
}

@media (min-width: 640px) {
  .media {
    padding-bottom: 36px;
  }

  .phone {
    right: -8px;
    width: 26%;
  }
}

@media (min-width: 1000px) {
  .service-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1180px) {
  .phone {
    right: -28px;
  }
}
