:root {
  color-scheme: dark;
  --ink: #f8f2e8;
  --muted: rgba(248, 242, 232, 0.68);
  --hairline: rgba(248, 242, 232, 0.22);
  --panel: rgba(26, 24, 21, 0.7);
  --panel-deep: rgba(9, 9, 8, 0.82);
  --brass: #d8b56d;
  --sage: #a7b69d;
  --clay: #be7f64;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: #171511 url("assets/interior-wall.png") center / cover no-repeat;
  color: var(--ink);
  font-family: Optima, Candara, "Segoe UI", system-ui, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.18) 58%, rgba(0, 0, 0, 0.45)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.58));
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(20px, 4vw, 56px);
}

.clock-panel {
  width: min(1220px, 100%);
  padding: clamp(24px, 4.2vw, 56px);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 38%),
    var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px) saturate(1.08);
}

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: clamp(26px, 4vw, 48px);
  border-bottom: 1px solid var(--hairline);
}

.kicker,
.section-label,
.field-label,
footer,
.totals p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 860px;
  margin: 8px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.1rem, 8vw, 8.9rem);
  font-weight: 500;
  line-height: 0.86;
}

.current-time {
  flex: 0 0 auto;
  min-width: 178px;
  padding-top: 6px;
  color: var(--ink);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 600;
  text-align: right;
}

.portrait-row {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(260px, 0.7fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: end;
  margin: clamp(24px, 4vw, 46px) 0;
}

.album {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.portrait {
  position: relative;
  margin: 0;
  overflow: hidden;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(248, 242, 232, 0.2);
  border-radius: 8px;
  aspect-ratio: 16 / 10;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 58% 48%;
}

button {
  font: inherit;
}

.portrait:focus-visible,
.album-nav:focus-visible,
.album-thumb:focus-visible {
  outline: 3px solid rgba(216, 181, 109, 0.72);
  outline-offset: 3px;
}

.album-controls {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 10px;
  align-items: center;
}

.album-nav {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(248, 242, 232, 0.24);
  border-radius: 999px;
  background: rgba(9, 9, 8, 0.62);
  color: var(--ink);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

.album-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.album-thumb {
  height: clamp(58px, 8vw, 84px);
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(248, 242, 232, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  opacity: 0.62;
}

.album-thumb.is-active {
  border-color: var(--brass);
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(216, 181, 109, 0.16);
}

.album-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 48%;
}

.portrait-copy {
  display: grid;
  gap: 14px;
  padding-bottom: 4px;
}

.portrait-copy p:last-child {
  max-width: 430px;
  margin: 0;
  color: rgba(248, 242, 232, 0.78);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 2.5vw, 2.2rem);
  line-height: 1.18;
}

.settings {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto minmax(150px, 0.7fr);
  align-items: center;
  gap: 14px 16px;
  margin: 0 0 clamp(24px, 4vw, 46px);
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.readonly-value {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  height: 46px;
  border: 1px solid rgba(248, 242, 232, 0.28);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 0 12px;
}

.age-feature {
  display: grid;
  gap: 18px;
}

.age-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.age-line span {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.4rem, 12vw, 12rem);
  font-weight: 600;
  line-height: 0.78;
  font-variant-numeric: tabular-nums;
}

.age-line small {
  color: var(--muted);
  font-size: clamp(1rem, 2.1vw, 1.6rem);
  font-weight: 600;
}

.sub-age {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
}

.sub-age strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.totals {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(30px, 5vw, 64px);
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--hairline);
}

.totals article {
  min-width: 0;
  padding: clamp(14px, 2.2vw, 24px);
  background: var(--panel-deep);
}

.totals span {
  display: block;
  min-height: 1.2em;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.9vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.totals p {
  margin-top: 10px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  color: rgba(248, 242, 232, 0.54);
}

@media (max-width: 860px) {
  .masthead,
  footer {
    flex-direction: column;
  }

  .current-time {
    text-align: left;
  }

  .settings {
    grid-template-columns: 1fr;
  }

  .portrait-row {
    grid-template-columns: 1fr;
  }

  .totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .shell {
    padding: 14px;
    place-items: stretch;
  }

  .clock-panel {
    min-height: calc(100vh - 28px);
  }

  .totals {
    grid-template-columns: 1fr;
  }

  .album-controls {
    grid-template-columns: 38px 1fr 38px;
  }

  .album-nav {
    width: 38px;
    height: 38px;
  }
}
