:root {
  --navy: #1b365d;
  --ink: #1f2933;
  --muted: #52606d;
  --line: #cbd2d9;
  --paper: #ffffff;
  --page: #eef1f4;
  --accent: #f5f7fa;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.wrapper {
  max-width: 1100px;
  min-height: 100%;
  margin: 0 auto;
  background: var(--paper);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

/* ===== Header (name left, 2x2 photo right, like a printed resume) ===== */
header {
  background: var(--navy);
  color: #ffffff;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

header h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: normal;
  letter-spacing: 1px;
  line-height: 1.2;
}

header .subtitle {
  font-size: 14.5px;
  color: #d9e2ec;
  margin-top: 6px;
}

header .contact {
  font-size: 14px;
  color: #d9e2ec;
  margin-top: 10px;
}

header .contact a { color: #ffffff; }

.photo {
  position: relative;
  flex: 0 0 170px;
  width: 170px;
  height: 170px;
  border: 3px solid #ffffff;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.photo .monogram {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  color: var(--navy);
  letter-spacing: 2px;
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Navigation buttons ===== */
nav {
  background: var(--accent);
  border-bottom: 1px solid var(--line);
  padding: 10px 32px;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

nav a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 13.5px;
  color: var(--navy);
  text-decoration: none;
  background: #ffffff;
  border: 1px solid var(--navy);
  border-radius: 3px;
}

nav a:hover,
nav a:focus-visible {
  background: var(--navy);
  color: #ffffff;
  outline: none;
}

nav a.active {
  background: var(--navy);
  color: #ffffff;
}

/* ===== Main (single column) ===== */
main {
  flex: 1;
  padding: 26px 32px;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: normal;
  color: var(--navy);
  border-bottom: 2px solid var(--navy);
  padding-bottom: 3px;
  margin-bottom: 10px;
}

main section + section { margin-top: 22px; }

/* ===== At a glance ===== */
main section.glance-sec {
  border-top: 2px solid var(--navy);
  padding-top: 16px;
}

.glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  padding: 10px 14px 12px;
  background: #ffffff;
}

.card h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}

.card .item + .item { margin-top: 6px; }

.card strong { display: block; font-size: 14.5px; color: var(--ink); line-height: 1.4; }

.card span { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--line);
  padding: 12px 32px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

/* ===== Resume buttons in header ===== */
header .resume-links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }

header .resume-links a {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  color: #ffffff;
  text-decoration: none;
  border: 1px solid #ffffff;
  border-radius: 3px;
}

header .resume-links a:hover,
header .resume-links a:focus-visible {
  background: #ffffff;
  color: var(--navy);
  outline: none;
}

/* ===== Application letter (one column) ===== */
.letter {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14.5px;
  line-height: 1.5;
}

.letter .recipient-compact { display: none; }

.letter p + p { margin-top: 8px; }

.letter-head,
.letter-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.letter-head { align-items: flex-start; margin-bottom: 10px; }

.letter-head p + p,
.letter-foot p + p { margin-top: 0; }

.letter .date { margin-bottom: 6px; }

.letter .closing { margin-top: 14px; }

.letter .signature { margin-top: 16px; }

.letter .enclosure { font-size: 13.5px; color: var(--muted); }

.letter a { color: var(--navy); }

@media (min-width: 761px) and (max-height: 860px) {
  .letter { font-size: 13.8px; line-height: 1.34; }
  .letter .date { margin-bottom: 3px; }
  .letter .recipient-full { display: none; }
  .letter .recipient-compact { display: block; }
  .letter p + p { margin-top: 3px; }
  .letter-head { margin-bottom: 4px; }
  .letter .closing { margin-top: 5px; }
  .letter .signature { margin-top: 4px; }
}

@media (max-width: 760px) {
  .letter-head, .letter-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .letter-head .date { order: -1; }
}

@media print {
  header .resume-links { display: none; }
}

/* ===== Work experience ===== */
.xp { display: flex; gap: 28px; align-items: flex-start; }

.xp-tabs { flex: 0 0 240px; display: flex; flex-direction: column; gap: 8px; }

.xp-tab {
  text-align: left;
  font: inherit;
  padding: 10px 14px;
  background: #ffffff;
  color: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 3px;
  cursor: pointer;
}

.xp-tab strong { display: block; font-size: 14.5px; }

.xp-tab span { display: block; font-size: 13px; color: var(--muted); }

.xp-tab:hover, .xp-tab:focus-visible { background: var(--accent); outline: none; }

.xp-tab[aria-selected="true"] { background: var(--navy); color: #ffffff; }

.xp-tab[aria-selected="true"] span { color: #d9e2ec; }

.xp-panels { flex: 1; min-width: 0; }

.xp-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }

.xp-head h3 { font-size: 16.5px; color: var(--ink); line-height: 1.35; }

.xp-org { font-size: 14px; color: var(--muted); }

.xp-date { font-size: 14px; color: var(--muted); white-space: nowrap; }

.xp-panel ul { margin: 10px 0 0 18px; }

.xp-panel li { margin-top: 5px; }

.xp-tech { margin-top: 10px; font-size: 13.5px; color: var(--muted); }

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

/* ===== Skills ===== */
.skills {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0 36px;
  align-items: start;
}

main .skills section + section { margin-top: 18px; }

.skill-group h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}

.skill-table { width: 100%; border-collapse: collapse; }

.skill-table th, .skill-table td {
  text-align: left;
  vertical-align: top;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.skill-table th { width: 150px; padding-right: 12px; color: var(--navy); font-weight: bold; }

.skill-list { list-style: none; }

.skill-list li { padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

.skill-group p { font-size: 14px; }

@media (max-width: 760px) {
  .xp { flex-direction: column; }
  .xp-tabs { flex: none; width: 100%; }
  .xp-head { flex-direction: column; gap: 2px; }
  .skills { grid-template-columns: 1fr; }
}

/* ===== Character references ===== */
.refs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.ref {
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  padding: 14px 16px 16px;
}

main .refs section + section { margin-top: 0; }

.ref h3 { font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: normal; color: var(--navy); }

.ref-role { font-size: 14px; font-weight: bold; color: var(--ink); margin-top: 2px; }

.ref-rel { font-size: 13px; color: var(--muted); }

.ref blockquote {
  margin-top: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink);
}

.refs-note { margin-top: 14px; font-size: 13.5px; color: var(--muted); }

@media (max-width: 760px) {
  .refs { grid-template-columns: 1fr; }
}

/* ===== Short laptop screens: tighten spacing so nothing needs scrolling ===== */
@media (min-width: 761px) and (max-height: 860px) {
  header { padding-top: 10px; padding-bottom: 10px; }
  header .contact { margin-top: 6px; }
  header h1 { font-size: 26px; }
  header .subtitle { margin-top: 3px; }
  header .contact { margin-top: 4px; }
  header .resume-links { margin-top: 6px; }
  header .resume-links a { padding: 2px 10px; }
  .photo { flex-basis: 110px; width: 110px; height: 110px; }
  nav { padding-top: 7px; padding-bottom: 7px; }
  main { padding-top: 10px; padding-bottom: 6px; }
  h2 { margin-bottom: 6px; }
  main section + section { margin-top: 12px; }
  main p { line-height: 1.5; }
  main section.glance-sec { padding-top: 12px; }
  .card { padding: 7px 12px 8px; }
  footer { padding-top: 7px; padding-bottom: 7px; }
  .page-title { font-size: 20px; margin-bottom: 10px; }
  .xp-panel li { margin-top: 3px; line-height: 1.5; }
  .skill-table th, .skill-table td, .skill-list li { padding: 3px 0; }
}

/* ===== Small screens ===== */
@media (max-width: 760px) {
  header, nav, main, footer { padding-left: 16px; padding-right: 16px; }
  header { flex-direction: column; text-align: center; }
  header .photo { order: -1; }
  header h1 { font-size: 24px; }
  .glance { grid-template-columns: 1fr; }
}

/* ===== Print ===== */
@media print {
  body { background: #ffffff; }
  nav { display: none; }
  .wrapper { border: none; }
  header { background: #ffffff; color: var(--navy); border-bottom: 2px solid var(--navy); }
  header .subtitle, header .contact { color: var(--muted); }
  header .contact a { color: var(--navy); }
  .photo { border-color: var(--line); }
}

/* ===== Inner page title ===== */
.page-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: normal;
  color: var(--navy);
  border-bottom: 2px solid var(--navy);
  padding-bottom: 4px;
  margin-bottom: 14px;
}
