:root {
  color-scheme: light;
  --bg: #e7f1ee;
  --glow: rgba(12, 110, 100, 0.16);
  --text: #10211e;
  --soft: #3c524d;
  --muted: #5c736e;
  --line: rgba(16, 33, 30, 0.12);
  --card: #ffffff;
  --card-hover: #f3faf8;
  --accent: #0c6e64;
  --accent-hover: #09584f;
  --on-accent: #f4fffd;
  --chip: #dcebe7;
  --chip-text: #16332f;
  --shadow: 0 10px 30px rgba(16, 33, 30, 0.06);
  --theme-color: #e7f1ee;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #071311;
  --glow: rgba(94, 234, 212, 0.14);
  --text: #e7f6f2;
  --soft: #c5ddd7;
  --muted: #93b0aa;
  --line: rgba(231, 246, 242, 0.12);
  --card: #10211e;
  --card-hover: #16302c;
  --accent: #5eead4;
  --accent-hover: #8af6e6;
  --on-accent: #04221e;
  --chip: #17302c;
  --chip-text: #d7f3ee;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  --theme-color: #071311;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 100% -80px, var(--glow), transparent 55%),
    var(--bg);
  padding:
    calc(20px + env(safe-area-inset-top))
    calc(20px + env(safe-area-inset-right))
    calc(48px + env(safe-area-inset-bottom))
    calc(20px + env(safe-area-inset-left));
}

button, a { -webkit-tap-highlight-color: transparent; }

.page {
  width: min(100%, 980px);
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.city {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seg {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

.seg button,
.theme-btn,
.copy-btn {
  font: inherit;
  cursor: pointer;
  border: 0;
  color: var(--text);
  background: transparent;
}

.seg button,
.theme-btn {
  min-height: 40px;
  border-radius: 999px;
}

.seg button {
  min-width: 44px;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.seg button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.theme-btn {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 0.92rem;
}

.seg button:focus-visible,
.theme-btn:focus-visible,
.btn:focus-visible,
.copy-btn:focus-visible,
.email-address:focus-visible,
.toast a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.role {
  margin: 0;
  color: var(--accent);
  font-weight: 650;
  font-size: 0.95rem;
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.bio {
  margin: 14px 0 0;
  max-width: 40rem;
  color: var(--soft);
  font-size: 1.05rem;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.btn {
  min-height: 68px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.btn:hover { background: var(--card-hover); }

.btn-sub {
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}

.btn-primary .btn-sub { color: inherit; }

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

.mail-btn {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.email-address {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}

.copy-btn {
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.85rem;
  font-weight: 650;
}

.copy-btn:hover { background: var(--card-hover); }

.layout {
  display: grid;
  gap: 28px;
  margin-top: 36px;
}

h2 {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.timeline > li {
  display: grid;
  gap: 4px;
}

.when {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.card,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}

.card { border-left: 3px solid var(--accent); }

h3 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.job-role {
  margin: 4px 0 0;
  color: var(--accent);
  font-weight: 650;
}

.job-text {
  margin: 8px 0 0;
  color: var(--soft);
}

.side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.chips li {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--chip-text);
  font-size: 0.9rem;
}

.panel .when { margin-top: 6px; }

.toast {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
}

.toast[hidden] { display: none; }

.toast p { margin: 0; }

.toast a {
  color: inherit;
  font-weight: 700;
  white-space: nowrap;
}

@media (min-width: 800px) {
  .layout {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    align-items: start;
  }

  .side { order: -1; }

  .timeline > li {
    grid-template-columns: 9.5rem minmax(0, 1fr);
    gap: 8px 18px;
    align-items: start;
  }

  .timeline .when { padding-top: 16px; }
}

@media (min-width: 860px) {
  .actions {
    grid-template-columns: 1fr 0.85fr 1.35fr;
  }
}

@media (min-width: 900px) {
  body { padding-top: calc(36px + env(safe-area-inset-top)); }
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tools button {
  font: inherit;
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.tools button:hover,
.tools button:focus-visible { background: var(--card); }

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

.print-only { display: none; }

.job-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.now {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metrics {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
}

.metrics li {
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
  background: var(--bg);
}

.metrics strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.metrics span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.skill-groups { display: grid; gap: 14px; }

.skill-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media print {
  body {
    background: #fff;
    color: #10211e;
    padding: 0;
  }

  .toolbar,
  .tools,
  .actions,
  .toast { display: none !important; }

  .print-only {
    display: block;
    margin: 8px 0 0;
    color: #3c524d;
  }

  .role,
  .job-role,
  .now { color: #0c6e64; }

  .now {
    background: #0c6e64;
    color: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .card,
  .panel,
  .metrics li {
    background: #fff;
    box-shadow: none;
    break-inside: avoid;
  }

  .metrics li { background: #f4f7f6; }

  .page { width: auto; }
}

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