/* 定點 — personal start page */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-variable.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-italic-variable.woff") format("woff");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-variable.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-variable.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Outfit";
  src: url("../fonts/outfit-variable.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif TC";
  src: url("../fonts/noto-serif-tc-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif TC";
  src: url("../fonts/noto-serif-tc-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #f7f1e8;
  --cream-deep: #efe4d4;
  --ink: #102033;
  --ink-soft: #3a4a5c;
  --navy: #0a2240;
  --navy-92: rgba(8, 28, 56, 0.84);
  --glass: rgba(255, 250, 244, 0.88);
  --glass-quiet: rgba(255, 250, 244, 0.78);
  --line: rgba(255, 247, 238, 0.22);
  --line-dark: rgba(16, 32, 51, 0.1);
  --accent: #e3582f;
  --shadow: 0 12px 40px rgba(2, 24, 56, 0.18);
  --serif: "Fraunces", "Noto Serif TC", "Songti SC", "PMingLiU", Georgia, serif;
  --display: "Playfair Display", "Noto Serif TC", "Songti SC", "PMingLiU", Georgia, serif;
  --sans: "Outfit", "Helvetica Neue", "Noto Sans TC", sans-serif;
  --cjk: "Noto Serif TC", "Songti SC", "PMingLiU", serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  background: #0479c3;
}

html:has(body.page-briefs) {
  background: #f4efe6;
}

body {
  font-family: var(--sans);
  color: var(--cream);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- World ---------- */

.world {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #0b1c2e;
}

.world-illustrated,
.world-illustrated img,
.world-custom {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}

.world-illustrated img {
  object-position: center 70%;
}

.world-illustrated img.is-portrait,
body[data-wallpaper="island"] .world-illustrated img {
  object-position: center 46%;
}

.world-custom {
  display: none;
}

body[data-wallpaper="custom"] .world-illustrated {
  display: none;
}

body[data-wallpaper="custom"] .world-custom {
  display: block;
}

.world-illustrated {
  transform-origin: 62% 58%;
  animation: scene-breathe 42s ease-in-out infinite;
  will-change: transform;
}

body[data-wallpaper="custom"] .world-custom {
  transform-origin: 50% 46%;
  animation: scene-breathe 42s ease-in-out infinite;
}

@keyframes scene-breathe {
  0%, 100% { transform: scale(1) translate3d(0, 0, 0); }
  50% { transform: scale(1.032) translate3d(-0.55%, -0.35%, 0); }
}

.world-illustrated img {
  opacity: 0;
  transition: opacity 1.2s ease;
}

.world-illustrated img.is-front {
  opacity: 1;
}

.world-shimmer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.1s ease;
  mix-blend-mode: screen;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 22%, #000 38%, #000 62%, transparent 76%),
    linear-gradient(to right, #000 0%, #000 56%, transparent 82%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 22%, #000 38%, #000 62%, transparent 76%),
    linear-gradient(to right, #000 0%, #000 56%, transparent 82%);
  mask-composite: intersect;
}

.world-water {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.world-water.is-on {
  opacity: 1;
}

body.is-period-bg .world-shimmer {
  opacity: 0.48;
}

body.is-period-bg.has-water .world-illustrated {
  animation: none;
}

body.is-period-bg.has-water .world-shimmer {
  opacity: 0;
}

.world-shimmer::before,
.world-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
}

.world-shimmer::before {
  background: linear-gradient(118deg, transparent 36%, rgba(255, 255, 255, 0.18) 48%, transparent 58%);
  background-size: 220% 220%;
  animation: sheen-move 18s ease-in-out infinite;
}

.world-shimmer::after {
  background-image:
    radial-gradient(1.4px 1.4px at 16% 48%, rgba(255, 255, 255, 0.55) 50%, transparent 70%),
    radial-gradient(1.2px 1.2px at 24% 52%, rgba(255, 255, 255, 0.4) 50%, transparent 70%),
    radial-gradient(1.6px 1.6px at 31% 46%, rgba(255, 255, 255, 0.5) 50%, transparent 70%),
    radial-gradient(1.1px 1.1px at 39% 54%, rgba(255, 255, 255, 0.35) 50%, transparent 70%),
    radial-gradient(1.3px 1.3px at 47% 49%, rgba(255, 255, 255, 0.42) 50%, transparent 70%),
    radial-gradient(1px 1px at 22% 57%, rgba(255, 255, 255, 0.32) 50%, transparent 70%),
    radial-gradient(1.5px 1.5px at 34% 51%, rgba(255, 255, 255, 0.46) 50%, transparent 70%);
  animation: sparkle-twinkle 5.5s ease-in-out infinite;
}

@keyframes sheen-move {
  0%, 100% { transform: translate3d(-6%, 2%, 0); opacity: 0.35; }
  50% { transform: translate3d(8%, -2%, 0); opacity: 0.75; }
}

@keyframes sparkle-twinkle {
  0%, 100% { opacity: 0.3; }
  40% { opacity: 0.85; }
  65% { opacity: 0.4; }
}

.water-ripples.ripples-a {
  animation: drift-a 56s linear infinite;
}

.water-ripples.ripples-b {
  animation: drift-b 84s linear infinite;
}

@keyframes drift-a {
  from { transform: translate(0, 0); }
  to   { transform: translate(-420px, -105px); }
}

@keyframes drift-b {
  from { transform: translate(0, 0); }
  to   { transform: translate(260px, -80px); }
}

#boat {
  animation: boat-drift 42s ease-in-out infinite;
}

@keyframes boat-drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(42px, 12px); }
}

/* ---------- App chrome ---------- */

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 30;
  background: var(--cream);
  color: var(--navy);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
}

.skip:focus {
  top: 16px;
}

.site-nav,
main {
  position: relative;
  z-index: 1;
}

/* ---------- Black top bar ---------- */

.site-nav {
  z-index: 8;
  background: #0b0b0d;
  color: #fff;
}

.site-nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px 16px;
  padding: 8px 22px;
  min-height: 52px;
}

.quick-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
  justify-self: center;
  grid-column: 2;
}

.site-nav-inner > .quick-links-label {
  justify-self: start;
  grid-column: 1;
}

.site-nav-inner > .wallpaper-toggle,
.site-nav-inner > .nav-home {
  justify-self: end;
  grid-column: 3;
}

.quick-links-label {
  font-family: var(--cjk);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.16em;
  line-height: 1.2;
  color: #fff;
  margin-right: 2px;
}

.nav-builtin {
  font-family: var(--cjk);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: #fff;
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 1px solid transparent;
}

.nav-builtin:hover,
.nav-builtin:focus-visible {
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

.nav-builtin.is-current {
  border-bottom-color: rgba(255, 255, 255, 0.85);
}

.nav-builtin:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.nav-slots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-slot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-slot a {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
  padding: 4px 2px;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-slot a:hover,
.nav-slot a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav-slot a:focus-visible,
.nav-slot-edit:focus-visible,
.nav-slot-empty:focus-visible,
.nav-add:focus-visible,
.wallpaper-toggle:focus-visible,
.nav-home:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.nav-slot-edit {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 2px 4px;
}

.nav-slot-edit:hover {
  color: #fff;
}

.nav-slot-empty,
.nav-add {
  border: 1px dashed rgba(255, 255, 255, 0.28);
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
}

.nav-slot-empty .cjk,
.nav-add .cjk,
.quick-links .cjk,
.wallpaper-toggle .cjk {
  font-family: var(--cjk);
  letter-spacing: 0.12em;
}

.nav-slot-empty:hover,
.nav-add:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.nav-home {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}

.nav-home:hover {
  background: rgba(255, 255, 255, 0.08);
}

.wallpaper-toggle {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  white-space: nowrap;
}

.wallpaper-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.wallpaper-toggle .cjk {
  opacity: 0.82;
}

/* ---------- Wallpaper panel ---------- */

.wallpaper-panel {
  position: fixed;
  top: 60px;
  right: 16px;
  z-index: 12;
  width: min(360px, calc(100vw - 24px));
  padding: 18px 18px 16px;
  background: var(--glass);
  color: var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.wallpaper-panel[hidden],
.link-dialog[hidden] {
  display: none;
}

.wallpaper-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wallpaper-panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.wallpaper-panel h2 .cjk {
  font-family: var(--cjk);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  margin-left: 0.35em;
  color: #5a6a7a;
}

.wallpaper-close {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wallpaper-close:hover {
  background: rgba(16, 32, 51, 0.08);
}

.wallpaper-lead,
.wallpaper-status {
  margin: 8px 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #5a6a7a;
}

.wallpaper-status.is-error {
  color: #8a2b1e;
}

.wallpaper-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.wallpaper-thumb {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 6px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink);
}

.wallpaper-thumb img {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: cover;
  border-radius: 10px;
}

.wallpaper-thumb-auto {
  grid-column: 1 / -1;
}

.wallpaper-thumb-auto img {
  height: 148px;
}

.wallpaper-thumb.is-selected {
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy);
}

.wallpaper-thumb:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.wallpaper-thumb .cjk {
  font-family: var(--cjk);
  letter-spacing: 0.1em;
  color: #5a6a7a;
  margin-left: 0.3em;
}

.wallpaper-custom-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.wallpaper-upload,
.wallpaper-reset {
  font-family: var(--sans);
  font-size: 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}

.wallpaper-upload {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: var(--navy);
  color: var(--cream);
  border: 0;
}

.wallpaper-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.wallpaper-upload:focus-within {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.wallpaper-reset {
  padding: 8px 14px;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid rgba(16, 44, 80, 0.18);
}

.wallpaper-reset:hover {
  background: rgba(16, 32, 51, 0.05);
}

.wallpaper-custom-preview[hidden],
.form-error[hidden],
.btn-danger[hidden],
.nav-add[hidden] {
  display: none !important;
}

.wallpaper-custom-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.wallpaper-custom-preview img {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(16, 44, 80, 0.12);
}

/* ---------- Link editor ---------- */

.link-dialog {
  position: fixed;
  z-index: 20;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  width: min(380px, calc(100vw - 24px));
  padding: 20px 20px 16px;
  background: var(--glass);
  color: var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.link-dialog h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: #5a6a7a;
}

.field input {
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: 0;
  color: var(--ink);
  border: 1px solid rgba(16, 44, 80, 0.16);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
}

.field input:focus {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
}

.form-error {
  margin: 0 0 10px;
  color: #8a2b1e;
  font-size: 0.85rem;
}

.link-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.btn-solid,
.btn-quiet,
.btn-danger {
  font-family: var(--sans);
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.btn-solid {
  background: var(--navy);
  color: var(--cream);
  border: 0;
}

.btn-quiet {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid rgba(16, 44, 80, 0.16);
}

.btn-danger {
  margin-left: auto;
  background: transparent;
  color: #8a2b1e;
  border: 1px solid rgba(138, 43, 30, 0.25);
}

/* ---------- Hero ---------- */

main {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 52px);
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 24px 32px;
  flex: 1 1 auto;
}

.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(820px, 90vw);
  height: 320px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(2, 44, 92, 0.28), rgba(2, 44, 92, 0.08) 45%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}

.greeting {
  margin: 0;
  font-family: "Bodoni Moda", "Playfair Display", "Noto Serif TC", Georgia, serif;
  font-weight: 500;
  font-style: normal;
  font-size: clamp(1.33245rem, 3.2886vw, 2.9484rem);
  font-variation-settings: "opsz" 96, "wght" 500;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--cream);
  text-shadow: 0 2px 30px rgba(2, 28, 64, 0.38);
}

.datetime {
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.45rem 0.7rem;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: rgba(247, 241, 232, 0.9);
  text-shadow: 0 1px 12px rgba(2, 28, 64, 0.35);
}

.datetime .dot {
  opacity: 0.55;
}

.datetime .zone {
  font-weight: 400;
  opacity: 0.86;
}

.zone .cjk {
  font-family: var(--cjk);
  font-weight: 400;
  letter-spacing: 0.12em;
  margin-left: 0.15em;
}

/* ---------- Search ---------- */

.search {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(620px, calc(100vw - 40px));
  height: 56px;
  padding: 6px 6px 6px 16px;
  background: rgba(255, 250, 244, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  box-shadow: var(--shadow), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  color: var(--ink);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.search:focus-within {
  box-shadow: var(--shadow), 0 0 0 4px rgba(247, 241, 232, 0.35);
}

.search-icon {
  flex: 0 0 auto;
  display: flex;
  color: #5a6a7a;
}

.search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.search input[type="search"]::placeholder {
  color: #7a8794;
}

.search input[type="search"]::-webkit-search-decoration,
.search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.modes {
  flex: 0 0 auto;
  display: flex;
  margin: 0;
  padding: 3px;
  border: 0;
  background: rgba(16, 44, 80, 0.07);
  border-radius: 999px;
  gap: 0;
}

.modes input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.modes label {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 999px;
  color: #5a6a7a;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.modes label svg {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.modes label .logo-grok {
  width: 17px;
  height: 17px;
}

.modes input:checked + label {
  background: #fff;
  color: #5a6a7a;
  box-shadow: 0 1px 3px rgba(16, 32, 51, 0.12);
}

.modes input:focus-visible + label {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.search-go {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: var(--cream);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
}

.search-go:hover {
  background: #16345c;
}

.search-go:active {
  transform: scale(0.96);
}

.search-go:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.search .icon-harper {
  display: none;
}

.search.is-harper .icon-search {
  display: none;
}

.search.is-harper .icon-harper {
  display: block;
}

/* ---------- Dashboard ---------- */

.dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 32px;
}

.card {
  position: relative;
  min-height: 188px;
  padding: 0;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  background: rgba(255, 250, 244, 0.96);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(40, 28, 16, 0.14), 0 1px 2px rgba(40, 28, 16, 0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.45s ease, box-shadow 0.45s ease;
}

.card-media {
  position: relative;
  height: 110px;
  margin: 10px 10px 0;
  border-radius: 16px;
  overflow: hidden;
  flex: 0 0 auto;
  background: #d4cdc2;
}

.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  transform: scale(1.01);
  transform-origin: center center;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(40, 28, 16, 0.18), 0 1px 2px rgba(40, 28, 16, 0.06);
}

.card:hover .card-media img {
  transform: scale(1.1);
}

.card-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 1 auto;
  padding: 16px 18px 18px;
  min-height: 0;
}

.card-label {
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6a7a8a;
}

.card-weather {
  background: rgba(255, 250, 244, 0.96);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.weather-temp {
  margin: 14px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 3.05rem;
  letter-spacing: -0.035em;
  line-height: 1;
}

.weather-temp .unit {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: 0;
  margin-left: 0.08em;
  position: relative;
  top: -0.95em;
}

.weather-condition {
  margin: 8px 0 0;
  font-size: 1rem;
  font-weight: 400;
}

.weather-place {
  margin-top: auto;
  padding-top: 14px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: #6a7a8a;
}

.weather-place .cjk {
  font-family: var(--cjk);
  letter-spacing: 0.12em;
}

.card-weather.is-empty .weather-temp,
.card-weather.is-loading .weather-temp {
  display: none;
}

.weather-status {
  margin: 16px 0 0;
  font-size: 1rem;
  line-height: 1.45;
  max-width: 16rem;
}

.card-weather.is-ready .weather-status {
  display: none;
}

.card-usage,
.card-reserved {
  background: rgba(255, 250, 244, 0.96);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.card-message {
  margin: 22px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.42rem;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--ink);
}

.card-sub {
  margin: 8px 0 0;
  font-family: var(--cjk);
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  color: #5a6a7a;
}

.card-usage .card-note,
.card-reserved .card-note {
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: #7a8794;
}

.card-reserved {
  background: rgba(255, 250, 244, 0.9);
}

.card-reserved::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(16, 44, 80, 0.16);
  border-radius: 16px;
  pointer-events: none;
}

.card-reserved .card-message {
  color: #3e5060;
  font-size: 1.28rem;
}

.card-mark {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  color: rgba(16, 44, 80, 0.28);
}

/* ---------- Entrance ---------- */

body:not(.is-ready) .site-nav {
  animation: fade-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

body:not(.is-ready) .hero::before {
  animation: fade-only 0.7s ease 0.08s both;
}

body:not(.is-ready) .greeting {
  animation: fade-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

body:not(.is-ready) .datetime {
  animation: fade-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

body:not(.is-ready) .search {
  animation: fade-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both;
}

body:not(.is-ready) .card:nth-child(1) {
  animation: card-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.42s both;
}

body:not(.is-ready) .card:nth-child(2) {
  animation: card-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

body:not(.is-ready) .card:nth-child(3) {
  animation: card-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.58s both;
}

body:not(.is-ready) .card:nth-child(4) {
  animation: card-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.66s both;
}

@keyframes world-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fade-only {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes card-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */

@media (min-width: 560px) {
  .dashboard {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1080px) {
  .dashboard {
    grid-template-columns: repeat(4, 1fr);
    width: min(1120px, calc(100% - 56px));
    padding-bottom: 36px;
  }
}

@media (max-width: 639px) {
  .site-nav {
    position: relative;
  }

  .site-nav-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label toggle"
      "links links";
    align-items: center;
    gap: 8px 12px;
    padding: 8px 16px;
  }

  .site-nav-inner > .quick-links-label {
    grid-area: label;
    grid-column: auto;
    justify-self: start;
  }

  .site-nav-inner > .wallpaper-toggle,
  .site-nav-inner > .nav-home {
    grid-area: toggle;
    grid-column: auto;
    position: static;
    justify-self: end;
  }

  .quick-links {
    grid-area: links;
    grid-column: auto;
    justify-self: stretch;
    justify-content: center;
    padding-right: 0;
  }

  .nav-slot-empty,
  .nav-add {
    padding: 4px 10px;
    font-size: 0.72rem;
  }

  .hero {
    padding: 20px 20px 24px;
  }

  .datetime {
    font-size: 0.82rem;
    gap: 0.3rem 0.5rem;
  }

  .search {
    height: 52px;
    flex-wrap: nowrap;
    border-radius: 999px;
    padding: 5px 5px 5px 14px;
    gap: 6px;
  }

  .search input[type="search"] {
    width: 0;
    flex: 1 1 auto;
    font-size: 0.95rem;
  }

  .modes label {
    padding: 5px 7px;
    gap: 3px;
  }

  .modes label svg {
    width: 15px;
    height: 15px;
  }

  .modes label .logo-grok {
    width: 16px;
    height: 16px;
  }

  .search-go {
    width: 38px;
    height: 38px;
  }

  .card {
    min-height: 168px;
  }

  .weather-temp {
    font-size: 2.6rem;
  }
}

@media (max-height: 780px) and (min-width: 1080px) {
  .hero {
    padding: 20px 24px 20px;
  }

  .search {
    margin-top: 1.4rem;
  }

  .card {
    min-height: 164px;
  }
}

/* ---------- Motion prefs ---------- */

@media (prefers-reduced-motion: reduce) {
  .world,
  .world-illustrated,
  .world-custom,
  .world-shimmer,
  .world-shimmer::before,
  .world-shimmer::after,
  .site-nav,
  .hero,
  .hero::before,
  .greeting,
  .datetime,
  .search,
  .card,
  .dashboard,
  .water-ripples,
  #boat {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .world-illustrated img,
  .card,
  .card-media img {
    transition: none;
  }

  .world-shimmer,
  .world-water {
    opacity: 0 !important;
    animation: none !important;
  }

  .world-water {
    display: none !important;
  }

  .card:hover {
    transform: none;
  }

  .card:hover .card-media img {
    transform: scale(1.01);
  }
}

.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;
}


/* ---------- Briefs archive ---------- */

body.page-briefs {
  background: #f4efe6;
  color: var(--ink);
  min-height: 100dvh;
}

.briefs-main {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.briefs-kicker {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6a7a8a;
}

.briefs-title {
  margin: 10px 0 0;
  font-family: var(--cjk);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.1rem);
  letter-spacing: 0.12em;
  color: var(--navy);
}

.briefs-lead {
  margin: 14px 0 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 36rem;
}

.briefs-lead .cjk {
  font-family: var(--cjk);
  letter-spacing: 0.08em;
}

.nowrap {
  white-space: nowrap;
}

.briefs-status {
  margin: 28px 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: #6a7a8a;
}

.briefs-status.is-error {
  color: #8a2b1e;
}

.briefs-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  border-top: 1px solid rgba(16, 44, 80, 0.12);
}

.briefs-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 16px;
  padding: 18px 4px;
  border-bottom: 1px solid rgba(16, 44, 80, 0.12);
  color: inherit;
  text-decoration: none;
}

.briefs-item:hover,
.briefs-item:focus-visible {
  background: rgba(255, 255, 255, 0.55);
}

.briefs-item:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.briefs-item-title {
  font-family: var(--cjk);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: 0.08em;
  color: var(--navy);
}

.briefs-item-meta {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.briefs-zone .cjk {
  font-family: var(--cjk);
  letter-spacing: 0.1em;
  margin-left: 0.2em;
}

.briefs-item-action {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a7a8a;
}

@media (min-width: 640px) {
  .briefs-item {
    grid-template-columns: 1.1fr 1.2fr auto;
    align-items: baseline;
    padding: 20px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wallpaper-panel,
  .link-dialog {
    transition: none !important;
  }
}
