/*
 * Shared layout. Colors, fonts and shapes come from the theme file,
 * so restyling never touches this file.
 */
*, *::before, *::after { box-sizing: border-box; }

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

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

a { color: var(--link); }

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin-bottom: 1.1em; }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }

/*
 * Sections span the full width so the hero band can be navy edge to edge;
 * the padding keeps the content itself in a centred 1000px column.
 */
main > section {
  padding: clamp(56px, 9vw, 96px) max(16px, calc((100% - 1000px) / 2)) 0;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bar-bg);
  backdrop-filter: blur(10px);
}
.brand { font-family: var(--font-head); font-weight: 700; color: var(--on-navy); text-decoration: none; }
.topbar nav { display: flex; gap: clamp(12px, 3vw, 28px); font-size: .92rem; }
.topbar nav a { color: var(--on-navy-muted); text-decoration: none; }
.topbar nav a:hover { color: var(--accent); }

/* Hero */
main > .hero { padding-bottom: clamp(48px, 8vw, 80px); background: var(--navy); color: var(--on-navy); }
.hero-head { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.hero h1 { margin: 0; }
.photo { width: 112px; height: 112px; flex: none; border-radius: 50%; border: 3px solid var(--accent); object-fit: cover; }
.role { margin: 4px 0 0; color: var(--accent); font-weight: 600; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 680px; }
.hero .lead { color: var(--on-navy-muted); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-block;
  min-height: 48px;
  padding: 12px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font: 600 1rem var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s;
}
.button:hover { transform: translateY(-2px); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }

.prose { max-width: 680px; font-size: 1.08rem; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.card, .project {
  margin: 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card p { color: var(--muted); margin: 0; }

.projects { display: grid; gap: 18px; max-width: 760px; }
.project { border-left: 3px solid var(--accent); }
.project .tag { font-size: .82rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .4em; }
.project .result { font-weight: 600; margin: 0; }

/* Contact form */
#contact-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 620px; margin-top: 28px; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field legend { font-weight: 600; padding: 0; }
.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field .choice { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 400; cursor: pointer; }
.choice input { width: 20px; height: 20px; accent-color: var(--navy); }
.field-error { margin: 0; color: var(--error); font-size: .92rem; }
.field-error:empty { display: none; }
#form-status:empty { display: none; }
#form-status { padding: 14px 18px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.privacy { margin: 0; font-size: .88rem; color: var(--muted); }

.footer { margin-top: 96px; padding: 28px 16px; background: var(--navy); color: var(--on-navy-muted); text-align: center; font-size: .85rem; }
.footer p { max-width: 720px; margin: 0 auto; }

@media (min-width: 760px) {
  .photo { width: 140px; height: 140px; }
}

/* On narrow phones, the brand name gives up its space to the menu. */
@media (max-width: 400px) {
  .brand { display: none; }
  .topbar { justify-content: center; }
}

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