/* arpadherbut.com: site styles (no framework). */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef3f9;
  --text: #0e1726;
  --muted: #4a5a70;
  --border: #dbe3ee;
  --accent: #1c6fb0;
  --accent-strong: #0f5a94;
  --accent-soft: #e2effa;
  --on-accent: #ffffff;
  --grid: rgba(28, 111, 176, 0.08);
  --media-bg: #ffffff;
  --shadow: 0 1px 2px rgba(14, 23, 38, 0.05), 0 10px 30px rgba(14, 23, 38, 0.07);
  --shadow-hover: 0 2px 4px rgba(14, 23, 38, 0.06), 0 18px 40px rgba(14, 23, 38, 0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a111e;
    --surface: #0f1a2c;
    --surface-2: #13223a;
    --text: #e7eef7;
    --muted: #9fb2c8;
    --border: #1f2e48;
    --accent: #5cb1ea;
    --accent-strong: #8ccbf3;
    --accent-soft: #11304d;
    --on-accent: #06101c;
    --grid: rgba(92, 177, 234, 0.07);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.45);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
}

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

a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-strong);
}

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

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
}
h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 750;
}
h3 {
  font-size: 1.2rem;
  font-weight: 700;
}
p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  left: 12px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.lead {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--muted);
  max-width: 38ch;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--mono);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 248, 251, 0.82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(10, 17, 30, 0.8);
  }
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand:hover {
  color: var(--text);
}
.monogram {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
}
.nav-links .nav-cta {
  margin-left: 8px;
  color: var(--on-accent);
  background: var(--accent);
}
.nav-links .nav-cta:hover {
  color: var(--on-accent);
  background: var(--accent-strong);
}
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 20px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .site-header[data-open] .nav-links {
    display: flex;
  }
  .nav-links a {
    padding: 12px 14px;
    font-size: 1.05rem;
  }
  .nav-links .nav-cta {
    margin: 8px 0 0;
    justify-content: center;
  }
}

/* ---------- Icons ---------- */
.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  color: var(--text);
  border-color: var(--accent);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.chip {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  line-height: 1.4;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 9vw, 112px) 0 clamp(48px, 7vw, 88px);
}
.hero::before {
  /* blueprint grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
}
.hero h1 .accent {
  color: var(--accent);
}
.hero .lead {
  margin-bottom: 2rem;
}
.hero .chips {
  margin-top: 2rem;
}
.figure-card {
  position: relative;
  margin: 0;
  padding: 18px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.figure-card img {
  border-radius: 12px;
  background: var(--media-bg);
  width: 100%;
}
.figure-card figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.figure-card::before,
.figure-card::after {
  /* drawing-sheet corner marks */
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--accent);
  border-style: solid;
}
.figure-card::before {
  top: -8px;
  left: -8px;
  border-width: 2px 0 0 2px;
}
.figure-card::after {
  bottom: -8px;
  right: -8px;
  border-width: 0 2px 2px 0;
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    max-width: 420px;
  }
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(56px, 8vw, 96px) 0;
}
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-head {
  max-width: 640px;
  margin-bottom: 40px;
}
.section-head p {
  color: var(--muted);
}

.page-head {
  padding: clamp(48px, 7vw, 88px) 0 8px;
}
.page-head .lead {
  max-width: 52ch;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.about-text p {
  font-size: 1.08rem;
}
.facts {
  margin: 0;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  display: grid;
  gap: 18px;
}
.section-alt .facts {
  background: var(--bg);
}
.facts dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.facts dd {
  margin: 2px 0 0;
  font-weight: 600;
}
@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

/* Toolbox */
.toolbox {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.tool-group {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.tool-group h3 {
  font-size: 1rem;
  margin-bottom: 14px;
}

/* Timeline (home) */
.timeline {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  border-left: 2px solid var(--border);
}
.timeline li {
  position: relative;
  padding: 0 0 26px 28px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.section-alt .timeline li::before {
  background: var(--surface);
}
.timeline li:first-child::before {
  background: var(--accent);
}
.timeline .when {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.timeline .what {
  font-weight: 700;
  font-size: 1.08rem;
}
.timeline .role {
  color: var(--muted);
}

/* ---------- Work cards (portfolio) ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  padding-bottom: clamp(56px, 8vw, 96px);
}
.work-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.work-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.work-card .media {
  aspect-ratio: 3 / 2;
  background: var(--media-bg);
  border-bottom: 1px solid var(--border);
}
.work-card .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.work-card .body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 22px 24px;
}
.work-card .when {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.work-card h2 {
  font-size: 1.3rem;
  margin-bottom: 2px;
}
.work-card .role {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}
.work-card p {
  color: var(--muted);
  font-size: 0.98rem;
}
.work-card .chips {
  margin: auto 0 20px;
  padding-top: 4px;
}
.work-card .btn {
  align-self: flex-start;
  min-height: 44px;
}

/* ---------- Dialog ---------- */
dialog.detail {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
dialog.detail::backdrop {
  background: rgba(6, 12, 22, 0.6);
  backdrop-filter: blur(3px);
}
.detail-head {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 28px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.detail-head h2 {
  font-size: 1.5rem;
  margin: 0;
}
.detail-head .role {
  color: var(--accent);
  font-weight: 600;
}
.detail-head .when {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.detail-close {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.detail-close:hover {
  border-color: var(--accent);
}
.detail-body {
  padding: 22px 28px 28px;
}
.detail-body h3 {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 26px 0 10px;
}
.detail-body ul {
  margin: 0;
  padding-left: 1.2em;
}
.detail-body li {
  margin-bottom: 8px;
}
.detail-body li::marker {
  color: var(--accent);
}
body:has(dialog[open]) {
  overflow: hidden;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding-bottom: clamp(56px, 8vw, 96px);
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.contact-card:hover {
  color: var(--text);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
.contact-card .icon-tile {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.2rem;
}
.contact-card .label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.contact-card .value {
  font-weight: 650;
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}
.contact-card .action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}
.contact-card:hover .action,
.contact-card:focus-visible .action {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* CTA band */
.cta {
  text-align: center;
}
.cta .btn-row {
  justify-content: center;
}
.cta p {
  color: var(--muted);
  max-width: 48ch;
  margin: 0 auto 28px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--accent);
}

/* ---------- Motion ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn,
  .work-card,
  .contact-card {
    transition: none;
  }
  .btn:hover,
  .work-card:hover,
  .contact-card:hover {
    transform: none;
  }
}

/* Spacing helpers */
.pad-top {
  padding-top: 32px;
}
.pad-bottom {
  padding-bottom: 96px;
}
