:root {
  color-scheme: dark;
  --bg: #111211;
  --bg-soft: #151614;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.088);
  --line: rgba(220, 232, 242, 0.095);
  --line-strong: rgba(220, 232, 242, 0.18);
  --text: #f2eee5;
  --text-soft: #c8cbc8;
  --muted: #858b8b;
  --accent: #7f99ad;
  --accent-strong: #b8c9d5;
  --accent-ink: #0f1418;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 22px 70px rgba(3, 3, 2, 0.42);
  --font: "Avenir Next", "SF Pro Display", "SF Pro Text", "Helvetica Neue", ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SF Mono", "Roboto Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -16rem, rgba(95, 126, 150, 0.22), transparent 35rem),
    linear-gradient(180deg, #141719 0%, var(--bg) 34%, #0f100f 100%);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

.board,
.year-card,
.year-head,
.year-head *,
.goal,
.goal-trigger,
.goal-trigger *,
.item-shell,
.item-note,
.item-link,
.add-item,
.action-dialog {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea,
.editor-bar,
.editor-bar * {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 4;
  transform: translateY(-140%);
  border-radius: 999px;
  background: var(--accent-strong);
  color: var(--accent-ink);
  padding: 10px 14px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.055;
  background-image:
    radial-gradient(circle at 25% 30%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1px),
    radial-gradient(circle at 75% 70%, rgba(255, 255, 255, 0.45) 0 1px, transparent 1px);
  background-size: 34px 34px, 46px 46px;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 14px 72px;
}

.hero-slideshow {
  position: sticky;
  top: 0;
  z-index: 0;
  height: clamp(210px, 56vw, 300px);
  margin: 0 -14px;
  overflow: hidden;
  background: #080909;
  will-change: transform;
}

.hero-slideshow::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0%, rgba(17, 18, 17, 0.72) 56%, var(--bg) 100%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.68), transparent 66%);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition:
    opacity 520ms ease,
    transform 1400ms ease;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.hero-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  filter: saturate(0.9) contrast(0.98) brightness(0.78);
}

main {
  position: relative;
  z-index: 2;
  margin-top: -44px;
  padding-bottom: 1px;
}

.year-head h3,
dialog h2 {
  margin: 0;
  font-weight: 640;
  letter-spacing: -0.035em;
}

.eyebrow,
.year-kicker,
.helper {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 520;
}

.eyebrow,
.year-kicker {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button,
.small-button,
.quick-actions button,
.add-year-inline,
dialog menu button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  transition:
    transform 170ms ease,
    border-color 170ms ease,
    background 170ms ease,
    color 170ms ease;
}

.icon-button {
  display: grid;
  width: 40px;
  place-items: center;
  padding: 0;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

button:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

button:active {
  transform: scale(0.97);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(127, 153, 173, 0.72);
  outline-offset: 2px;
}

label {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 720;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(8, 9, 8, 0.36);
  color: var(--text);
  outline: none;
  transition:
    border-color 170ms ease,
    background 170ms ease,
    box-shadow 170ms ease;
}

input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.48;
}

input::placeholder,
textarea::placeholder {
  color: rgba(200, 203, 200, 0.4);
}

input:focus,
textarea:focus {
  border-color: rgba(127, 153, 173, 0.56);
  background: rgba(8, 9, 8, 0.54);
  box-shadow: 0 0 0 4px rgba(127, 153, 173, 0.12);
}

dialog menu button[value="default"] {
  padding: 0 14px;
  border-color: rgba(127, 153, 173, 0.28);
  background: var(--accent-strong);
  color: var(--accent-ink);
  font-size: 0.9rem;
  font-weight: 680;
}

.board {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
}

.add-year-inline {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 18px auto 0;
  place-items: center;
  border-color: rgba(242, 238, 229, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(16px) saturate(130%);
}

.add-year-inline span {
  font-size: 1.55rem;
  font-weight: 260;
  line-height: 1;
  transform: translateY(-1px);
}

.year-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.028)),
    rgba(18, 19, 18, 0.82);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.2);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.year-card.pressing {
  transform: scale(0.992);
  border-color: rgba(127, 153, 173, 0.28);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.24),
    0 0 0 3px rgba(127, 153, 173, 0.055);
}

.year-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
}

.year-head h3 {
  display: flex;
  align-items: baseline;
  gap: clamp(14px, 5vw, 28px);
  margin-top: 7px;
  font-family: var(--font);
  font-size: clamp(2rem, 11vw, 3.05rem);
  font-weight: 520;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.year-value {
  color: var(--text);
}

.age-value {
  color: rgba(242, 238, 229, 0.58);
  font-size: 0.58em;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.small-button {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 13px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 620;
}

.divider {
  display: none;
}

.goals {
  display: grid;
  gap: 1px;
  padding: 0 10px 10px;
}

.goal {
  border-radius: 16px;
  transition:
    transform 160ms ease,
    background 160ms ease,
    opacity 160ms ease;
}

.goal.open {
  background: rgba(255, 255, 255, 0.045);
}

.goal.pressing {
  background: rgba(255, 255, 255, 0.055);
  transform: scale(0.992);
}

.goal.dragging {
  z-index: 3;
  opacity: 0.72;
  transform: scale(1.01);
}

.goal-trigger {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 8px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  text-align: left;
}

.chevron {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  transition:
    transform 220ms ease,
    background 220ms ease;
}

.chevron::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 5px;
  width: 5px;
  height: 5px;
  border-right: 2px solid rgba(242, 238, 229, 0.82);
  border-bottom: 2px solid rgba(242, 238, 229, 0.82);
  transform: rotate(-45deg);
}

.goal.open .chevron {
  transform: rotate(90deg);
  background: rgba(127, 153, 173, 0.18);
}

.goal-title {
  min-width: 0;
  font-size: clamp(1.02rem, 4.7vw, 1.2rem);
  font-weight: 540;
  line-height: 1.24;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.goal-body {
  display: none;
  padding: 0 12px 14px 40px;
}

.goal.open .goal-body {
  display: grid;
  gap: 12px;
  animation: reveal 220ms ease both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.items {
  display: grid;
  gap: 10px;
}

.item-shell {
  min-width: 0;
}

.item-image-shell {
  cursor: grab;
  touch-action: pan-y;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    filter 180ms ease;
}

.item-image-shell.dragging {
  cursor: grabbing;
  opacity: 0.62;
  transform: scale(0.985);
  filter: saturate(0.82);
}

.item-image-shell.image-broken {
  cursor: default;
}

.item-note,
.item-link {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
  color: #d9dcda;
  line-height: 1.5;
}

.item-link {
  display: block;
  border: 1px solid rgba(127, 153, 173, 0.2);
  color: var(--accent-strong);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.pin-embed-shell {
  display: grid;
  min-height: 220px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.024)),
    rgba(11, 13, 14, 0.72);
}

.pin-embed {
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.pin-embed-shell span,
.pin-embed-shell iframe {
  max-width: 100%;
}

.item-image {
  display: block;
  width: 100%;
  max-height: 390px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #20211f;
}

.image-placeholder {
  display: grid;
  min-height: 118px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(238, 235, 226, 0.46);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.add-item {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 48px;
  padding-top: 2px;
}

.add-item.is-editing {
  display: block;
  min-height: 54px;
}

.add-item-trigger {
  position: relative;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(242, 238, 229, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px) saturate(130%);
  transition:
    opacity 180ms ease,
    transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 180ms ease,
    background 180ms ease;
}

.add-item-trigger span {
  display: block;
  font-size: 1.45rem;
  font-weight: 280;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.add-item.open .add-item-trigger {
  opacity: 0;
  pointer-events: none;
  transform: rotate(45deg) scale(0.7);
}

.item-form {
  position: absolute;
  top: 2px;
  left: calc(50% - 21px);
  display: block;
  width: 146px;
  animation: none;
}

.item-form[hidden] {
  display: none;
}

.item-form.editing {
  position: relative;
  top: auto;
  left: auto;
  inset: auto;
  display: block;
  width: 100%;
  min-width: 0;
}

.item-form.editing .quick-actions {
  display: none;
}

.quick-actions {
  position: relative;
  display: block;
  align-items: center;
  min-height: 42px;
  margin-left: 0;
}

.quick-actions button {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  width: 42px;
  height: 42px;
  min-height: 42px;
  place-items: center;
  padding: 0;
  border-color: rgba(242, 238, 229, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
  opacity: 0;
  transform: translateX(0) scale(0.46);
  transform-origin: center center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.18);
  animation: action-slide 360ms cubic-bezier(0.16, 1.02, 0.22, 1) forwards;
  backdrop-filter: blur(16px) saturate(135%);
}

.quick-actions svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.pin-action svg {
  fill: currentColor;
  stroke: none;
}

.text-icon {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transform: translateY(-1px);
}

.quick-actions button:nth-child(1) {
  --action-x: -52px;
  animation-delay: 20ms;
}

.quick-actions button:nth-child(2) {
  --action-x: 0px;
  animation-delay: 58ms;
}

.quick-actions button:nth-child(3) {
  --action-x: 52px;
  animation-delay: 96ms;
}

.quick-actions button.active {
  border-color: rgba(205, 211, 204, 0.28);
  background: rgba(205, 211, 204, 0.18);
  color: var(--text);
}

.editor-bar {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 3px 10px 3px 4px;
  border: 1px solid rgba(220, 232, 242, 0.105);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.072), rgba(255, 255, 255, 0.032)),
    rgba(13, 15, 16, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.095),
    0 10px 26px rgba(0, 0, 0, 0.2);
  animation: editor-stretch 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  backdrop-filter: blur(18px) saturate(135%);
}

.editor-bar[hidden],
.editor-bar [hidden] {
  display: none;
}

.editor-close {
  display: grid;
  width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.052);
  color: rgba(242, 238, 229, 0.66);
}

.editor-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.editor-bar textarea,
.editor-bar input[type="url"] {
  min-height: 36px;
  height: 36px;
  padding: 7px 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.25;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.editor-bar textarea {
  resize: none;
  overflow: hidden;
}

.editor-bar textarea:focus,
.editor-bar input[type="url"]:focus {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  outline: none;
}

.editor-bar textarea:focus-visible,
.editor-bar input[type="url"]:focus-visible {
  outline: none;
}

.editor-bar:focus-within {
  border-color: rgba(127, 153, 173, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.088), rgba(255, 255, 255, 0.04)),
    rgba(14, 17, 18, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    0 0 0 3px rgba(127, 153, 173, 0.07),
    0 12px 28px rgba(0, 0, 0, 0.22);
}

.editor-bar textarea::placeholder,
.editor-bar input[type="url"]::placeholder {
  color: rgba(242, 238, 229, 0.34);
}

@keyframes action-slide {
  0% {
    opacity: 0;
    transform: translateX(0) scale(0.46);
    filter: blur(5px);
  }

  70% {
    opacity: 1;
    transform: translateX(calc(var(--action-x) + 5px)) scale(1.05);
    filter: blur(0);
  }

  100% {
    opacity: 1;
    transform: translateX(var(--action-x)) scale(1);
    filter: blur(0);
  }
}

@keyframes editor-stretch {
  from {
    opacity: 0;
    transform: translateX(-8px) scaleX(0.88);
    transform-origin: left center;
  }

  to {
    opacity: 1;
    transform: translateX(0) scaleX(1);
    transform-origin: left center;
  }
}

.empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  line-height: 1.45;
}

dialog {
  width: min(calc(100% - 28px), 480px);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: #171816;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
}

dialog::backdrop {
  background: rgba(7, 8, 7, 0.68);
  backdrop-filter: blur(10px);
}

dialog form {
  display: grid;
  gap: 14px;
}

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

dialog h2 {
  margin-top: 4px;
}

dialog menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.action-dialog {
  width: min(calc(100% - 42px), 340px);
}

.action-dialog form {
  gap: 10px;
}

.action-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 620;
  line-height: 1.35;
}

.action-menu {
  display: grid;
  grid-template-columns: 1fr;
}

.action-menu button {
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-weight: 620;
}

.action-menu .danger-action {
  border-color: rgba(255, 112, 112, 0.18);
  color: #ff9a9a;
}

.viewer-open {
  overflow: hidden;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 34%, rgba(127, 153, 173, 0.11), transparent 28rem),
    rgba(3, 4, 4, 0.92);
  backdrop-filter: blur(18px) saturate(120%);
}

.image-viewer[hidden] {
  display: none;
}

.image-viewer-stage {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
}

.image-viewer-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 18px;
  object-fit: contain;
  touch-action: none;
  user-select: none;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.48);
  transition: transform 90ms ease-out;
}

.image-viewer-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 21;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(220, 232, 242, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
  backdrop-filter: blur(16px) saturate(135%);
}

.image-viewer-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

@media (max-width: 380px) {
  .quick-actions {
    flex-wrap: wrap;
  }
}

@media (min-width: 760px) {
  .app-shell {
    width: min(100%, 760px);
    padding-inline: 26px;
  }

  .hero-slideshow {
    margin-inline: -26px;
  }

  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}
