:root {
  color-scheme: light;
  --bg: #f1f1ef;
  --paper: #fff;
  --ink: #111;
  --muted: #5f5f5b;
  --rule: #bdbdb8;
  --soft-rule: #deded9;
  --focus: #145c42;
  --page-width: 860px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, "Apple SD Gothic Neo", sans-serif;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-underline-offset: 3px; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 55%, transparent); outline-offset: 3px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  padding: 0 max(20px, calc((100vw - var(--page-width)) / 2));
  color: #f7f7f5;
  background: rgb(18 18 18 / 96%);
  border-bottom: 1px solid #30302f;
  backdrop-filter: blur(12px);
}
.brand { font-size: 13px; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand span { margin-left: 3px; color: #93938f; font-weight: 500; }
.toolbar { display: flex; align-items: center; gap: 10px; }
.locale-switch { display: flex; padding: 3px; background: #2b2b2a; border-radius: 8px; }
.locale-switch button {
  min-width: 42px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: #aaa;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}
.locale-switch button[aria-pressed="true"] { color: #111; background: #fff; }
.download {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #444;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
}
.download:hover { background: #292928; }

.page-shell { padding: 42px 18px 72px; }
.resume {
  width: min(100%, var(--page-width));
  min-height: 1120px;
  margin: 0 auto;
  padding: 64px 72px 76px;
  background: var(--paper);
  box-shadow: 0 20px 70px rgb(0 0 0 / 9%);
  font-size: 13.5px;
  line-height: 1.54;
}
.loading { color: var(--muted); }
.resume-header { padding-bottom: 8px; }
.resume-header h1 { margin: 0; font-size: 38px; line-height: 1.05; letter-spacing: -.055em; }
.headline { margin: 8px 0 2px; color: #30302e; font-size: 14px; }
.contact { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12.5px; }
.contact a { overflow-wrap: anywhere; }
.summary { max-width: 690px; margin: 22px 0 0; color: #333330; line-height: 1.67; }
.resume-section { margin-top: 32px; }
.resume-section h2 {
  margin: 0 0 15px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--rule);
  font-size: 16px;
  letter-spacing: -.025em;
}
.entry + .entry { margin-top: 24px; }
.entry-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; }
.entry h3 { margin: 0; font-size: 14.5px; letter-spacing: -.015em; }
.entry h3 span { margin-left: 5px; color: #6b6b67; font-size: 12.5px; font-weight: 500; }
.entry-role { margin: 3px 0 0; color: #363633; font-size: 12.5px; }
.entry-date { color: #4f4f4b; text-align: right; white-space: nowrap; font-size: 11.5px; }
.entry-summary { margin: 10px 0 0; color: #333330; }
.tech { margin: 6px 0 0; color: #666661; font-size: 11.5px; }
.highlights { margin: 9px 0 0; padding-left: 19px; }
.highlights li { margin: 5px 0; padding-left: 2px; }
.entry-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 0; font-size: 12px; }
.skill-row { display: grid; grid-template-columns: 150px 1fr; gap: 15px; padding: 4px 0; }
.skill-row strong { font-size: 12.5px; }
.skill-row span { color: #333330; }

@media (max-width: 720px) {
  .site-header { min-height: 58px; padding: 0 14px; }
  .locale-switch button { min-width: 44px; min-height: 44px; }
  .download { min-height: 44px; }
  .page-shell { padding: 0; }
  .resume { min-height: 0; padding: 40px 22px 58px; box-shadow: none; font-size: 14px; }
  .resume-header h1 { font-size: 34px; }
  .summary { margin-top: 18px; }
  .resume-section { margin-top: 29px; }
  .entry-head { display: flex; flex-direction: column; gap: 4px; }
  .entry-date { text-align: left; }
  .entry h3 span { display: block; margin: 2px 0 0; }
  .skill-row { grid-template-columns: 1fr; gap: 1px; padding: 7px 0; }
}

@media print {
  @page { size: A4; margin: 14mm 16mm; }
  body { background: #fff; }
  .site-header { display: none; }
  .page-shell { padding: 0; }
  .resume {
    width: auto;
    min-height: 0;
    padding: 0;
    box-shadow: none;
    font-size: 9.2pt;
    line-height: 1.42;
  }
  .resume-header h1 { font-size: 25pt; }
  .resume-section { margin-top: 18pt; break-inside: avoid-page; }
  .resume-section h2 { break-after: avoid-page; }
  .resume-section h2 + .entry { break-before: avoid-page; }
  .entry { break-inside: avoid; }
  .entry + .entry { margin-top: 14pt; }
  a { text-decoration: none; }
}
