@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --paper: #faf0df;
  --lime: #e2ee8a;
  --deep-clay: #211412;
  font-family: "DM Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--paper);
  background: var(--deep-clay);
}

button { color: inherit; font: inherit; }

button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 38px 24px;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #653629, var(--deep-clay) 80%);
}

.tennis-ball {
  position: relative;
  display: block;
  flex: none;
  width: 19px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: rotate(33deg);
}

.tennis-ball::before, .tennis-ball::after {
  content: "";
  position: absolute;
  top: -10%;
  width: 83%;
  height: 120%;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.tennis-ball::before { right: 67%; }
.tennis-ball::after { left: 67%; }

.phone {
  position: relative;
  width: min(100%, 364px);
  padding: 8px;
  border: 1px solid #d19677a6;
  border-radius: 48px;
  background: linear-gradient(138deg, #5d382d, #1a1414 44%, #422921);
  box-shadow: 0 30px 70px #130908b3, 0 7px 20px #10070675, inset 0 0 0 2px #fff1d21a;
}

.phone::before, .phone::after {
  content: "";
  position: absolute;
  width: 3px;
  border: 1px solid #8f5f4c;
  border-radius: 3px;
  background: #523127;
}

.phone::before { top: 115px; left: -3px; height: 63px; }
.phone::after { top: 145px; right: -3px; height: 48px; }

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: clamp(590px, calc(100svh - 106px), 720px);
  overflow: hidden;
  border-radius: 39px;
  background:
    linear-gradient(180deg, #1d100c92, #28151226 31%, #21141125 64%, #140c09d9),
    #8c3b23 url("assets/clay-court.webp") center / cover no-repeat;
}

.status-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 22px;
}

.status-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .09em;
}

.camera {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 87px;
  height: 23px;
  border: 1px solid #49302a;
  border-radius: 50px;
  background: #1d1312;
  transform: translateX(-50%);
}

.camera::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, #4a3d4e, #201b27 53%, #110d12 75%);
}

.status-icons { display: flex; align-items: center; gap: 8px; }

.signal {
  width: 17px;
  height: 12px;
  background: currentColor;
  clip-path: polygon(0 100%, 0 74%, 17% 74%, 17% 100%, 28% 100%, 28% 51%, 45% 51%, 45% 100%, 55% 100%, 55% 27%, 72% 27%, 72% 100%, 83% 100%, 83% 0, 100% 0, 100% 100%);
}

.battery {
  position: relative;
  width: 21px;
  height: 11px;
  border: 1px solid #f2e2ccaf;
  border-radius: 3px;
}

.battery::before, .battery::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.battery::before { inset: 2px 3px 2px 2px; border-radius: 1px; }
.battery::after { top: 3px; right: -3px; bottom: 3px; width: 1px; border-radius: 1px; }

.clock {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin: clamp(10px, 3vh, 31px) 0 0;
  color: #fff4e1;
  text-align: center;
  text-shadow: 0 2px 14px #25110b9c;
}

.clock span { font-size: 1rem; font-weight: 600; }

.clock time {
  font-size: clamp(4rem, 8.8vh, 5.5rem);
  line-height: .99;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.075em;
  padding-right: .075em;
}

.notification-area {
  position: relative;
  margin: clamp(18px, 3.7vh, 35px) 14px 18px;
}

.notification-list { display: grid; gap: 8px; }

.notification-row {
  min-width: 0;
  animation: arrive .36s cubic-bezier(.2, .75, .28, 1) both;
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(-10px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.notification {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 57px;
  padding: 8px 10px;
  border: 1px solid #ffe8d766;
  border-radius: 15px;
  background: #2b1c1aeb;
  color: #fff5e7;
  box-shadow: 0 4px 14px #160a0838, inset 0 1px #ffe3ca16;
  text-align: left;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transform: translateX(var(--offset, 0px));
  opacity: var(--fade, 1);
  transition: transform .26s cubic-bezier(.2, .75, .28, 1), opacity .2s ease;
}

.notification.dragging, .notification.dismissing { cursor: grabbing; }
.notification.dragging { transition: none; }
.notification.dismissing { pointer-events: none; }

.app-icon {
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--lime);
  color: #333920;
}

.app-icon .tennis-ball { width: 19px; }
.notification-content { display: grid; gap: 1px; min-width: 0; }
.notification-source, .notification-age { font-size: .75rem; line-height: 1.15; }
.notification-source { color: #e6cbb9; font-weight: 600; }
.notification-age { align-self: start; margin-top: 3px; color: #e6cbb9; }
.thought { font-size: 1rem; line-height: 1.22; font-weight: 600; }

.screen-message {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 9px 15px;
  border: 1px solid #ffe8d766;
  border-radius: 50px;
  background: #2b1c1aeb;
  text-align: center;
}

.home-indicator {
  position: absolute;
  bottom: 11px;
  left: 50%;
  width: 106px;
  height: 4px;
  border-radius: 6px;
  background: #fff2d8ca;
  transform: translateX(-50%);
}

.controls {
  display: grid;
  justify-items: center;
  margin-top: auto;
  padding: 0 10px 27px;
}

.replay {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid #fde4ca6b;
  border-radius: 50px;
  background: #291916b3;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: color .2s, background-color .2s, border-color .2s;
}

@media (hover: hover) {
  .replay:hover { border-color: var(--lime); background: var(--lime); color: #232018; }
}

.replay:active { transform: scale(.97); }

.replay-icon {
  position: relative;
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  transform: rotate(24deg);
}

.replay-icon::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -2px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
}

@media (max-width: 760px) {
  :root { background-color: #1d1312; }

  .stage {
    padding: 0;
    background: var(--deep-clay);
  }

  .phone::before, .phone::after, .camera, .home-indicator {
    display: none;
  }

  .phone { width: 100%; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .screen {
    min-height: 100svh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    border-radius: 0;
    background-position: center, center 53%;
  }
  .status-bar { min-height: 46px; padding-inline: max(22px, calc((100% - 406px) / 2)); }
  .clock { margin-top: clamp(3px, 3vh, 32px); }
  .clock time { font-size: clamp(3.8rem, 11vh, 6rem); }
  .notification-area {
    width: min(calc(100% - 28px), 410px);
    margin: clamp(14px, 4vh, 37px) auto 18px;
  }
  .controls { padding-bottom: 10px; }
}

@media (max-width: 760px) and (max-height: 650px) {
  .status-bar { min-height: 34px; }
  .clock time { font-size: clamp(3.3rem, 10.5vh, 4rem); }
  .notification-area { margin-top: 13px; }
  .notification-list { gap: 6px; }
  .notification { min-height: 50px; padding-block: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
