/* ---- Tokens ---- */
:root {
  --ink: #171b22;
  --ink-soft: #232a35;
  --paper: #f2ead8;
  --paper-dim: #e8ddc3;
  --teal: #3e8177;
  --gold: #c9a227;
  --text-light: #ece4d3;
  --text-muted: #a9a493;
  --text-dark: #1b2430;

  --font-display: "Fraunces", serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 10px;
  --wrap: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Native dropdown popups render with a light OS background regardless of
   page theme — style option rows explicitly so text stays legible there. */
select option {
  background-color: var(--paper);
  color: var(--text-dark);
}

/* ---- Password gate ---- */
html.gate-locked body { visibility: hidden; }

#site-gate {
  visibility: visible;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  padding: 24px;
}

.site-gate-card {
  width: 100%;
  max-width: 360px;
  background: var(--ink-soft);
  border: 1px solid rgba(236, 228, 211, 0.12);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
}

.site-gate-eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.site-gate-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-light);
}

.site-gate-sub {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.site-gate-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid rgba(236, 228, 211, 0.2);
  background: var(--ink);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 15px;
  margin-bottom: 12px;
}
.site-gate-input:focus {
  outline: none;
  border-color: var(--teal);
}

.site-gate-btn {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 6px;
  background: var(--teal);
  color: var(--text-light);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.site-gate-btn:hover { opacity: 0.9; }

.site-gate-error {
  min-height: 18px;
  margin: 12px 0 0;
  font-size: 13px;
  color: #d97066;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text-light);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

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

/* ---- Intro animation ---- */
@keyframes intro-slide-down {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes intro-deal-card {
  0%   { opacity: 0; transform: translateY(48px) scale(0.92) rotate(-2.5deg); }
  60%  { opacity: 1; transform: translateY(-4px) scale(1.01) rotate(0.4deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
@keyframes intro-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes intro-sheen {
  from { transform: translateX(-130%) skewX(-15deg); }
  to   { transform: translateX(160%) skewX(-15deg); }
}

.site-header {
  animation: intro-slide-down 0.6s ease both;
}

.hero-card {
  animation: intro-deal-card 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 40%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-130%) skewX(-15deg);
  animation: intro-sheen 1s ease 0.75s both;
  pointer-events: none;
}

.hero-card-top .stamp {
  display: inline-block;
  animation: intro-fade-up 0.5s ease both;
  animation-delay: 0.55s;
}
.hero-card-top .stamp-right { animation-delay: 0.62s; }

.hero-title,
.hero-role,
.hero-tagline,
.hero-actions,
.hero-photo {
  animation: intro-fade-up 0.6s ease both;
}
.hero-title   { animation-delay: 0.32s; }
.hero-role    { animation-delay: 0.4s; }
.hero-tagline { animation-delay: 0.46s; }
.hero-actions { animation-delay: 0.52s; }
.hero-photo   { animation-delay: 0.3s; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(23, 27, 34, 0.88);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(236, 228, 211, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--text-light);
}
.brand-mark { color: var(--gold); }

.main-nav a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-left: 28px;
  transition: color 0.15s ease;
}
.main-nav a:hover,
.main-nav a:focus-visible { color: var(--gold); }

.lang-toggle {
  display: inline-flex;
  vertical-align: middle;
  align-items: center;
  gap: 2px;
  margin-left: 28px;
  border: 1px solid rgba(236,228,211,0.15);
  border-radius: 100px;
  padding: 3px;
}
.lang-toggle button {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 5px 10px;
  border-radius: 100px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.lang-toggle button:hover { color: var(--text-light); }
.lang-toggle button.is-active {
  background: var(--gold);
  color: var(--text-dark);
}

/* ---- Hero ---- */
.hero {
  padding: 96px 24px 72px;
  display: flex;
  justify-content: center;
}

.hero-card {
  background: var(--paper);
  color: var(--text-dark);
  border-radius: var(--radius);
  max-width: 620px;
  width: 100%;
  padding: 40px 44px 44px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
  border: 1px solid rgba(27,36,48,0.08);
}

.hero-card-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.stamp { opacity: 0.7; }

.hero-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}
.hero-text { min-width: 0; }

.hero-photo {
  width: 100px;
  height: 130px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--paper);
  outline: 1px solid rgba(27,36,48,0.15);
  box-shadow: 0 8px 20px -8px rgba(0,0,0,0.35);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 56px);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.hero-role {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--teal);
  margin: 0 0 22px;
  letter-spacing: 0.02em;
}

.hero-tagline {
  font-size: 16px;
  color: #3a4250;
  max-width: 46ch;
  margin: 0 0 32px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--text-dark);
  color: var(--paper);
}
.btn-primary:hover { transform: translateY(-1px); background: #0e141c; }

.btn-ghost {
  border: 1px solid rgba(27,36,48,0.25);
  color: var(--text-dark);
}
.btn-ghost:hover { border-color: var(--text-dark); }

/* ---- Sections ---- */
.section { padding: 64px 24px; }

.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  margin: 0 0 6px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section-index {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--gold);
}
.section-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 36px;
}

/* ---- Card grid (catalog) ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, rgba(201,162,39,0.35), rgba(62,129,119,0.25));
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.35) 40%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.card:hover::after { transform: translateX(120%); }

.card-face {
  background: var(--paper);
  color: var(--text-dark);
  border-radius: calc(var(--radius) - 1px);
  padding: 22px 22px 24px;
  height: 100%;
  transition: transform 0.2s ease;
}
.card:hover .card-face { transform: translateY(-3px); }

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.card-no {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.card-type {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 100px;
  color: var(--paper);
}
.type-data { background: var(--teal); }
.type-web { background: #3a5a8c; }
.type-hobby { background: var(--gold); color: var(--text-dark); }
.type-next { background: transparent; border: 1px dashed var(--text-muted); color: var(--text-muted); }
.type-photo { background: #a8603f; color: var(--text-light); }
.type-maker { background: #5c6bc0; color: var(--text-light); }
.type-game { background: #2f9e63; color: var(--text-light); }

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  margin: 0 0 8px;
}

.card-desc {
  font-size: 14px;
  color: #3a4250;
  margin: 0 0 14px;
}

.card-tags {
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}
.card-tags li {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  border: 1px solid rgba(27,36,48,0.15);
  padding: 3px 8px;
  border-radius: 100px;
}

.card-empty .card-face {
  background: var(--paper-dim);
}
.card-empty .card-title,
.card-empty .card-desc { color: var(--text-muted); }

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text {
  font-size: 16px;
  color: var(--text-light);
  max-width: 60ch;
}
.about-text p + p {
  margin-top: 16px;
}

.profile-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.profile-photo {
  width: 100%;
  aspect-ratio: 10 / 13;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(236,228,211,0.15);
  box-shadow: 0 16px 30px -14px rgba(0,0,0,0.5);
}

.ledger { margin: 0; }
.ledger-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(236,228,211,0.12);
  font-family: var(--font-mono);
  font-size: 13px;
}
.ledger-row dt { color: var(--text-muted); }
.ledger-row dd { margin: 0; color: var(--gold); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid rgba(236,228,211,0.1);
  padding: 40px 24px;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 4px;
}
.footer-email {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold);
}
.footer-note {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 32ch;
  text-align: right;
  margin: 0;
}

/* ---- Photography gallery ---- */
.gallery-header { padding-bottom: 0; }
.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  transition: color 0.15s ease;
}
.back-link:hover { color: var(--gold); }

.gallery-section { padding-top: 32px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.gallery-item {
  display: block;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--paper-dim);
  aspect-ratio: 3 / 4;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 16, 0.92);
  z-index: 100;
  padding: 24px;
}
.lightbox.is-open { display: flex; }
.lightbox-img {
  max-width: 90vw;
  max-height: 82vh;
  border-radius: 6px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
}
.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 10px;
  transition: color 0.15s ease;
}
.lightbox-close:hover,
.lightbox-nav:hover { color: var(--gold); }
.lightbox-close { top: 20px; right: 24px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ---- Pitch diary ---- */
.tracker-section { padding-top: 32px; }
.tracker-section + .tracker-section { padding-top: 56px; }

.unlock-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.unlock-form input {
  height: 36px;
  box-sizing: border-box;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(236,228,211,0.2);
  background: rgba(236,228,211,0.04);
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 13px;
}
.unlock-error {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e0645a;
  min-height: 1em;
}

.diary-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.diary-toolbar:last-of-type { margin-bottom: 20px; }
.diary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  box-sizing: border-box;
  background: transparent;
  border: 1px solid rgba(236,228,211,0.25);
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 0 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.diary-btn:hover { border-color: var(--gold); color: var(--gold); }
.toolbar-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.toolbar-input {
  width: 120px;
  height: 36px;
  box-sizing: border-box;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid rgba(236,228,211,0.25);
  background: transparent;
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 12px;
}
.toolbar-input:focus { border-color: var(--gold); outline: none; }
.diary-btn.is-danger:hover { border-color: #e0645a; color: #e0645a; }
.diary-btn:disabled,
.diary-table input:disabled,
.diary-table select:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.diary-btn:disabled:hover { border-color: rgba(236,228,211,0.25); color: var(--text-light); }
.icon-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.icon-btn:disabled:hover { color: var(--text-muted); }

.diary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  padding: 16px 18px;
  border: 1px solid rgba(236,228,211,0.12);
  border-radius: var(--radius);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 6px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--gold);
  margin: 0;
}

.table-scroll { overflow-x: auto; margin-bottom: 12px; }
.diary-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}
.diary-table th, .diary-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(236,228,211,0.12);
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
.week-table {
  table-layout: fixed;
  width: 100%;
  min-width: 960px;
}
.week-table td { overflow: hidden; text-overflow: ellipsis; }
.week-table td:nth-child(3) { white-space: normal; overflow-wrap: break-word; }

.history-table {
  table-layout: fixed;
  min-width: 600px;
}
.history-table th:nth-child(1), .history-table td:nth-child(1) { width: 140px; }
.history-table th:nth-child(2), .history-table td:nth-child(2) { width: auto; }
.history-table th:nth-child(3), .history-table td:nth-child(3) { width: 130px; }
.history-table th:nth-child(4), .history-table td:nth-child(4) { width: 130px; }
.history-table td:nth-child(2) { white-space: normal; overflow-wrap: break-word; }
.diary-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.diary-table th.sort-th {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}
.diary-table th.sort-th:hover { color: var(--gold); }
.diary-table th.sort-th.is-active { color: var(--gold); }
.diary-table tfoot td {
  font-weight: 600;
  color: var(--gold);
  border-top: 2px solid rgba(201,162,39,0.4);
  border-bottom: none;
}
.diary-table input,
.diary-table select {
  width: 100%;
  min-width: 78px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 4px;
}
.diary-table input:hover,
.diary-table input:focus,
.diary-table select:hover,
.diary-table select:focus {
  border-color: rgba(236,228,211,0.25);
  background: rgba(236,228,211,0.05);
  outline: none;
}
.diary-table .add-row td { padding-top: 14px; }
.diary-table .add-row input { border-color: rgba(236,228,211,0.15); }
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px 6px;
  transition: color 0.15s ease;
}
.icon-btn:hover { color: #e0645a; }

.entry-form, .add-item-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.form-field input, .form-field select {
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid rgba(236,228,211,0.2);
  background: rgba(236,228,211,0.04);
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 13px;
  min-width: 130px;
}
.form-field input:focus, .form-field select:focus {
  border-color: var(--gold);
  outline: none;
}

.log-empty { color: var(--text-muted); font-size: 13px; padding: 10px 0; }

.outcome-good { color: #5ec98d; }
.outcome-bad { color: #e0645a; }

/* ---- Menu planner ---- */
.empty-note {
  padding: 14px 16px;
  border: 1px solid rgba(201,162,39,0.35);
  border-radius: var(--radius);
  background: rgba(201,162,39,0.08);
  color: var(--text-light);
  font-size: 13px;
  margin-bottom: 20px;
}
.empty-note a { color: var(--gold); text-decoration: underline; }

.warning-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.warning-list li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e0b95c;
  padding: 8px 12px;
  border: 1px solid rgba(224,185,92,0.3);
  border-radius: 6px;
  background: rgba(224,185,92,0.06);
}

.day-select {
  width: 100%;
  min-width: 160px;
  background: transparent;
  border: 1px solid rgba(236,228,211,0.2);
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 6px;
  border-radius: 4px;
}
.day-select:focus { border-color: var(--gold); outline: none; }

.diary-table tr.is-unfilled td { background: rgba(224,101,90,0.08); }
.diary-table tr.is-special td { background: rgba(62,129,119,0.1); }

.dish-preview {
  position: fixed;
  z-index: 600;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(236,228,211,0.2);
  box-shadow: 0 20px 40px -16px rgba(0,0,0,0.6);
  background: var(--ink-soft);
}
.dish-preview.is-visible { opacity: 1; transform: translateY(0); }
.dish-preview img { display: block; max-width: 380px; max-height: 320px; width: auto; height: auto; }

.dish-name-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dish-name-cell input { flex: 1 1 auto; min-width: 0; }
.photo-badge {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: inherit;
  opacity: 0.85;
  cursor: default;
  visibility: hidden;
}
.photo-badge.is-visible { visibility: visible; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  background: rgba(10, 12, 16, 0.85);
  padding: 40px 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 640px;
  background: var(--ink-soft);
  border: 1px solid rgba(236,228,211,0.15);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.modal-head h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--text-light);
  margin: 0;
}
.modal-subhead {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 22px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.settings-grid .form-field label { text-transform: none; letter-spacing: 0; }
.settings-grid .form-field input { min-width: 0; width: 100%; }

.validation-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid rgba(236,228,211,0.2);
  color: var(--text-muted);
}
.validation-badge.is-valid { color: #5ec98d; border-color: rgba(94,201,141,0.4); }
.validation-badge.is-invalid { color: #e0645a; border-color: rgba(224,101,90,0.4); }

/* ---- Profile page ---- */
.profile-section { padding-top: 0; padding-bottom: 40px; }
.profile-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 16px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.timeline-item {
  padding: 18px 20px;
  border: 1px solid rgba(236,228,211,0.12);
  border-radius: var(--radius);
}
.timeline-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.timeline-role {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--text-light);
}
.timeline-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  white-space: nowrap;
}
.timeline-org {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--teal);
  margin: 0 0 8px;
}
.timeline-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.timeline-desc:last-of-type { margin-bottom: 0; }

.pill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
}
.pill-list li {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid rgba(236,228,211,0.18);
  padding: 4px 10px;
  border-radius: 100px;
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
  .main-nav a { margin-left: 16px; }
  .lang-toggle { margin-left: 16px; }
  .profile-side { flex-direction: row; align-items: flex-start; }
  .profile-photo { max-width: 100px; }
  .hero-card { padding: 32px 24px; }
  .hero-content { flex-direction: column-reverse; gap: 20px; }
  .hero-photo { width: 76px; height: 98px; }
  .footer-note { text-align: left; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card::after, .card-face { transition: none; }
  .site-header,
  .hero-card,
  .hero-card::before,
  .hero-card-top .stamp,
  .hero-title,
  .hero-role,
  .hero-tagline,
  .hero-actions,
  .hero-photo {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
