@font-face {
  font-family: "Newsreader";
  src: url("assets/newsreader-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("assets/newsreader-medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("assets/newsreader-italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f4ede0;
  --text: #2b2823;
  --muted: #7a7268;
  --accent: #1f3a5f;
  --accent-soft: #4a6a8f;
  --olive: #4a5840;
  --olive-soft: #6b7256;
  --rule: rgba(43, 40, 35, 0.12);
  --rule-warm: rgba(74, 88, 64, 0.22);
  --inactive: rgba(43, 40, 35, 0.3);
  --show-moon: block;
  --show-sun: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #23201a;
  --text: #e9e1d3;
  --muted: #9a9183;
  --accent: #9fb9db;
  --accent-soft: #7490b2;
  --olive: #abb596;
  --olive-soft: #8c9674;
  --rule: rgba(233, 225, 211, 0.14);
  --rule-warm: rgba(171, 181, 150, 0.28);
  --inactive: rgba(233, 225, 211, 0.27);
  --show-moon: none;
  --show-sun: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #23201a;
    --text: #e9e1d3;
    --muted: #9a9183;
    --accent: #9fb9db;
    --accent-soft: #7490b2;
    --olive: #abb596;
    --olive-soft: #8c9674;
    --rule: rgba(233, 225, 211, 0.14);
    --rule-warm: rgba(171, 181, 150, 0.28);
    --inactive: rgba(233, 225, 211, 0.27);
    --show-moon: none;
    --show-sun: block;
  }
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

html { font-size: 18px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-variation-settings: "opsz" 18;
  line-height: 1.35;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 180ms ease, color 180ms ease;
}

button,
a { font: inherit; }

button { color: inherit; }

[hidden] { display: none !important; }

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

main {
  width: min(100%, 1440px);
  height: 100svh;
  margin: 0 auto;
  padding: 0.8rem 1.7rem 0.65rem;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.55rem;
}

.embed main {
  grid-template-rows: auto minmax(0, 1fr);
  padding-top: 0.45rem;
}

.embed .internal-nav { display: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.internal-nav {
  width: min(100%, 680px);
  min-height: 30px;
  margin: 0 auto;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.breadcrumb {
  margin: 0;
  display: flex;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-style: italic;
}

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

.breadcrumb a:hover { color: var(--accent); }

.theme-toggle {
  width: 28px;
  height: 28px;
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .moon { display: var(--show-moon); }
.theme-toggle .sun { display: var(--show-sun); }

.artifact-intro {
  width: min(100%, 780px);
  margin: 0.2rem auto 0.05rem;
  font-size: clamp(1.35rem, 2.1vw, 1.8rem);
  line-height: 1.25;
  font-variation-settings: "opsz" 34;
  letter-spacing: -0.012em;
}

.day-canvas {
  position: relative;
  width: min(100%, 1280px);
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  isolation: isolate;
}

.day-canvas::before {
  content: "";
  position: absolute;
  inset: 7% 3% 10%;
  border: 1px solid var(--rule-warm);
  border-radius: 50%;
  opacity: 0.34;
  pointer-events: none;
  z-index: -2;
  transition: opacity 300ms ease, inset 380ms cubic-bezier(.2,.75,.2,1);
}

.day-canvas[data-occupation="1"]::before { inset: 9% 6% 11%; opacity: 0.3; }
.day-canvas[data-occupation="2"]::before { inset: 13% 11% 14%; opacity: 0.24; }
.day-canvas[data-occupation="3"]::before { inset: 18% 16% 18%; opacity: 0.18; }
.day-canvas[data-occupation="4"]::before { inset: 24% 22% 23%; opacity: 0.11; }
.day-canvas[data-occupation="5"]::before { inset: 31% 29% 30%; opacity: 0.04; }

.work-paths,
.mobile-work-paths {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: -1;
}

.mobile-work-paths { display: none; }

.path {
  fill: none;
  stroke: var(--accent-soft);
  stroke-width: 1.45;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  pathLength: 1;
}

.path[data-visible="true"] {
  opacity: 0.72;
  animation: draw-path 620ms cubic-bezier(.2,.72,.2,1) forwards;
}

.path[data-available="true"] {
  opacity: 0.22;
  stroke-dasharray: 0.025 0.035;
  stroke-dashoffset: 0;
}

.path-delegate[data-visible="true"],
.path-return[data-visible="true"] { opacity: 0.95; }

@keyframes draw-path {
  to { stroke-dashoffset: 0; }
}

.source-cluster {
  position: absolute;
  left: 2.4%;
  top: 31%;
  width: 27%;
}

.source-label,
.agent-anchor p,
.human-anchor p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
}

.source-label { margin-top: 0.34rem; }

.endpoint-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.endpoint-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gmail-logo img { width: 37px; height: 37px; }

.primary-task {
  max-width: 10ch;
  margin: 0.4rem 0 0.7rem;
  font-size: clamp(2.8rem, 4.7vw, 4.35rem);
  font-weight: 500;
  font-variation-settings: "opsz" 64;
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.delegate-action {
  min-height: 48px;
  padding: 0.15rem 0;
  border: 0;
  border-bottom: 1px solid var(--accent-soft);
  background: transparent;
  color: var(--accent);
  font-size: clamp(1.55rem, 2.25vw, 2.1rem);
  font-style: italic;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.delegate-action:hover { color: var(--olive); border-color: var(--olive-soft); }
.delegate-action:disabled { color: var(--muted); border-color: transparent; cursor: default; opacity: 0.48; }

.agent-anchor {
  position: absolute;
  left: 30%;
  top: 42%;
  width: 90px;
  text-align: center;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.agent-anchor .endpoint-logo { margin: 0 auto 0.25rem; }
.agent-anchor p { color: var(--text); font-style: normal; }
.agent-anchor small { color: var(--muted); font-size: 0.72rem; font-style: italic; }

.human-anchor {
  position: absolute;
  left: 50.5%;
  top: 50%;
  width: 64px;
  text-align: center;
  transform: translate(-50%, -50%);
  opacity: 1;
  transition: opacity 160ms ease;
}

main[data-day-state="opening"] .human-anchor { opacity: 0; }

.human-anchor > span {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.3rem;
  display: block;
  border: 1px solid var(--olive-soft);
  border-radius: 50%;
  position: relative;
}

.human-anchor > span::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  left: 13px;
  top: 7px;
  border: 1px solid var(--olive);
  border-radius: 50%;
}

.human-anchor > span::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 8px;
  left: 8px;
  bottom: 6px;
  border: 1px solid var(--olive);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
}

.human-anchor p { color: var(--olive); }

.agent-result {
  position: absolute;
  left: 39%;
  top: 40.5%;
  margin: 0;
  color: var(--accent);
  animation: reveal-text 360ms ease both;
}

.agent-result strong,
.agent-result small { display: block; }
.agent-result strong { font-size: 1.2rem; font-weight: 500; }
.agent-result small { color: var(--muted); font-size: 0.7rem; font-style: italic; }

@keyframes reveal-text {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.work-task {
  position: absolute;
  max-width: 250px;
  min-height: 48px;
  padding: 0.2rem 0;
  border: 0;
  background: var(--bg);
  color: var(--accent);
  display: flex;
  align-items: flex-start;
  gap: 0.58rem;
  text-align: left;
  font-size: clamp(1.5rem, 2.4vw, 2.35rem);
  font-variation-settings: "opsz" 40;
  line-height: 1.02;
  letter-spacing: -0.022em;
  cursor: pointer;
  z-index: 1;
  animation: possibility-in 420ms cubic-bezier(.2,.75,.2,1) both;
  transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.work-task:hover { color: var(--olive); transform: translateY(-2px); }

.work-task[data-commitment="true"] {
  color: var(--text);
  cursor: default;
  opacity: 0.84;
}

.work-task[data-commitment="true"] .task-mark {
  color: var(--olive);
  border-color: var(--olive-soft);
}

.work-task:disabled:hover { transform: none; }

@keyframes possibility-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.task-mark {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  margin-top: 0.08rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  font-size: 0.76rem;
  line-height: 1;
}

svg.task-mark {
  padding: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.linkedin-mark {
  border-radius: 2px;
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
}

.work-task[data-commitment="true"] .linkedin-mark {
  background: var(--olive);
  color: var(--bg);
}

.word-mark { font-weight: 500; }
.mail-mark { font-size: 1rem; }

.task-essay { left: 55%; top: 9%; }
.task-evidence { left: 80%; top: 6%; }
.task-linkedin { left: 80%; top: 27%; }
.task-send { left: 64%; top: 42%; }
.task-coauthor { left: 82%; top: 49%; }
.task-form { left: 60%; top: 65%; }
.task-figure { left: 80%; top: 80%; }

.final-line {
  position: absolute;
  left: 3.5%;
  bottom: 3.5%;
  width: 48%;
  margin: 0;
  color: var(--olive);
  font-size: clamp(2.15rem, 3.8vw, 3.55rem);
  font-style: italic;
  font-variation-settings: "opsz" 56;
  line-height: 1.02;
  letter-spacing: -0.025em;
  animation: final-in 520ms cubic-bezier(.2,.75,.2,1) both;
}

@keyframes final-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.quiet-actions {
  position: absolute;
  right: 2%;
  bottom: 2.5%;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.quiet-actions button {
  min-height: 44px;
  padding: 0.15rem 0;
  border: 0;
  border-bottom: 1px solid var(--rule-warm);
  background: transparent;
  color: var(--olive);
  font-size: 1rem;
  font-style: italic;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}

.quiet-actions button:hover { color: var(--accent); border-color: var(--accent-soft); }

main[data-day-state="working"] .agent-anchor .endpoint-logo {
  animation: working-pulse 900ms ease-in-out infinite alternate;
}

@keyframes working-pulse {
  from { opacity: 0.54; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

main[data-day-state="filled"] .source-cluster,
main[data-day-state="protected"] .source-cluster {
  opacity: 0.25;
  transition: opacity 320ms ease;
}

main[data-day-state="protected"] .work-task:not([data-commitment="true"]) { opacity: 0.24; }

@media (max-width: 720px) {
  html { font-size: 17px; }

  main {
    padding: 0.35rem 0.9rem 0.4rem;
    gap: 0.3rem;
  }

  .embed main { padding-top: 0.35rem; }

  .internal-nav {
    min-height: 25px;
    padding-bottom: 0.25rem;
  }

  .breadcrumb { font-size: 0.68rem; }
  .theme-toggle { width: 25px; height: 25px; padding: 4px; }

  .artifact-intro {
    margin-top: 0.05rem;
    font-size: clamp(1.25rem, 6.2vw, 1.48rem);
    line-height: 1.12;
  }

  .day-canvas::before {
    inset: 3% 7% 9%;
    border-radius: 46%;
  }

  .work-paths { display: none; }
  .mobile-work-paths { display: block; }

  .source-cluster {
    left: 0;
    top: 2.5%;
    width: 58%;
  }

  .endpoint-logo { width: 31px; height: 31px; }
  .gmail-logo img { width: 29px; height: 29px; }
  .source-label { display: none; }

  .primary-task {
    max-width: 11ch;
    margin: 0.18rem 0 0.25rem;
    font-size: clamp(2rem, 9vw, 2.35rem);
    line-height: 0.93;
  }

  .delegate-action {
    min-height: 42px;
    font-size: clamp(1.25rem, 5.8vw, 1.55rem);
  }

  .agent-anchor {
    left: 76%;
    top: 10.5%;
    width: 78px;
  }

  .agent-anchor .endpoint-logo { width: 38px; height: 38px; }
  .agent-anchor p { font-size: 0.72rem; }

  .human-anchor {
    left: 50%;
    top: 30.8%;
  }

  .human-anchor > span { width: 31px; height: 31px; }
  .human-anchor > span::before { left: 11px; top: 6px; }
  .human-anchor > span::after { left: 6px; bottom: 5px; }

  .agent-result {
    left: 57%;
    top: 19.5%;
  }

  .agent-result strong { font-size: 1rem; }

  .work-task {
    max-width: 148px;
    min-height: 40px;
    gap: 0.38rem;
    font-size: clamp(1.08rem, 5vw, 1.28rem);
    line-height: 0.98;
  }

  .task-mark {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
    font-size: 0.64rem;
  }

  svg.task-mark { padding: 4px; }
  .linkedin-mark { font-size: 0.72rem; }

  .task-essay { left: 0; top: 35%; }
  .task-send { left: auto; right: 0; top: 33%; }
  .task-evidence { left: auto; right: 0; top: 46%; }
  .task-linkedin { left: 0; top: 56%; }
  .task-coauthor { left: auto; right: 0; top: 65%; }
  .task-form { left: 0; top: 73%; }
  .task-figure { left: auto; right: 0; top: 81%; }

  .final-line {
    left: 0;
    bottom: 1.5%;
    width: 88%;
    font-size: clamp(1.65rem, 7.6vw, 1.95rem);
  }

  .quiet-actions {
    right: 0;
    bottom: 0.6%;
  }

  .quiet-actions button {
    min-height: 38px;
    font-size: 0.82rem;
  }

  main[data-day-state="filled"] .quiet-actions,
  main[data-day-state="protected"] .quiet-actions {
    bottom: 22%;
  }

}

@media (prefers-reduced-motion: reduce) {
  .day-canvas,
  .day-canvas *,
  .day-canvas *::before,
  .day-canvas *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}
