/* ============================================================
   Veriza Legacy — design tokens
   ink      #12333C  deep sea ink (text)
   teal     #1C7C8C  primary accent
   aqua     #4FB3BF  progress highlight
   glass    #EAF4F5  pale sea-glass tint
   hairline #DDE8E9  borders
   ============================================================ */

:root {
  --ink: #12333C;
  --ink-soft: #5C7A81;
  --teal: #156082;
  --teal-deep: #0F4A65;
  --aqua: #5FB6CE;
  --glass: #EAF4F5;
  --hairline: #DDE8E9;
  --white: #FFFFFF;
  --tile: 140px;        /* square tile side */
  --notes-w: 96px;      /* notes box width  */
  --radius: 10px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Outfit", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--white) url("background.jpg") center / cover fixed no-repeat;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 300;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Banner ---------- */

.banner {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;       /* fits width, crops the rest */
  object-position: center 55%;
}

.banner-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(18,51,60,0.10), rgba(255,255,255,0) 55%);
  pointer-events: none;
}

.masthead {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 48px;
  pointer-events: none;
}

.masthead-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  height: clamp(56px, 7.5vw, 86px);
  width: auto;
  filter: drop-shadow(0 1px 8px rgba(14, 58, 68, 0.5));
}

.masthead h1 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 60px);
  letter-spacing: 0.14em;
  color: var(--white);
  text-shadow: 0 1px 14px rgba(14, 58, 68, 0.5);
  transform: translateY(6px);
}

.masthead-rule {
  width: 64px;
  height: 1px;
  background: rgba(255, 255, 255, 0.85);
}

.masthead-quote {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(0.8rem, 1.4vw, 17px);
  letter-spacing: 0.06em;
  color: var(--white);
  text-align: right;
  max-width: 40%;
  text-shadow: 0 1px 10px rgba(14, 58, 68, 0.55);
  transform: translateY(19px);
}

/* ---------- Toolbar ---------- */

.toolbar {
  width: 100%;
  padding: 22px 32px 6px 48px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
}

.notice {
  flex: 1;
  margin-right: auto;
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 0.86rem;
  line-height: 1.55;
  letter-spacing: 0.015em;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(3px);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 12px 18px;
}

.mode-toggle {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--white);
  border: 1px solid var(--teal);
  border-radius: 999px;
  padding: 8px 26px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.mode-toggle:hover { background: var(--glass); }

.mode-toggle { box-shadow: 0 1px 4px rgba(18,51,60,0.08); }

.mode-toggle[aria-pressed="true"] {
  background: var(--teal);
  color: var(--white);
}

.mode-toggle:focus-visible,
.tile-name:focus-visible,
.pct-input:focus-visible,
.notes textarea:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 2px;
}

.save-indicator {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.save-indicator.show { opacity: 1; }

/* ---------- Board ---------- */

.board {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;                 /* anchored left, like the mockup */
  padding: 34px 32px 56px 48px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.row {
  display: flex;
  justify-content: flex-start;   /* rows start from the left, never stretched */
  flex-wrap: wrap;
  gap: 20px;
}

/* Each unit = square tile + notes box on its right */
.unit {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

/* ---------- Tile ---------- */

.tile {
  width: var(--tile);
  height: var(--tile);
  background: linear-gradient(160deg, #1A6E93, var(--teal) 55%, var(--teal-deep));
  border: 1px solid var(--teal-deep);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(18, 51, 60, 0.05), 0 8px 22px rgba(18, 51, 60, 0.06);
  display: flex;
  flex-direction: column;
  padding: 14px 14px 12px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.unit:hover .tile {
  box-shadow: 0 2px 5px rgba(18, 51, 60, 0.07), 0 12px 30px rgba(18, 51, 60, 0.10);
  transform: translateY(-2px);
}

/* Progress bar sits just under the top of the tile */
.bar {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
  overflow: hidden;
  flex-shrink: 0;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  /* gradient C: indigo -> teal early -> long run of green.
     Pinned to the FULL bar width and revealed as progress grows. */
  background-image: linear-gradient(90deg, #3A1FD0 0%, #19C8D8 35%, #5CF5A8 100%);
  background-repeat: no-repeat;
  background-size: calc(100% * 100 / var(--pct, 100)) 100%;
  transition: width 0.5s ease;
}

.tile-name {
  margin-top: 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.25;
  color: var(--white);
  overflow-wrap: break-word;
  border-radius: 4px;
}

.tile-name.placeholder { color: rgba(255,255,255,0.55); font-style: italic; font-weight: 400; }

.tile-pct {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 3px;
  transform: translateY(-28px);
}

.pct-value {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 21px;
  color: var(--white);
  letter-spacing: -0.01em;
}

.pct-sign {
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
}

.pct-input {
  width: 58px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 18px;
  color: var(--teal);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--white);
}

/* ---------- Notes box ---------- */

.notes {
  width: var(--notes-w);
  height: var(--tile);           /* equal to tile height */
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(4px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 9px;
  display: flex;
}

.notes textarea {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  resize: none;
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--ink);
}

.notes textarea::placeholder { color: #A9C2C6; }
.notes textarea:disabled { color: var(--ink-soft); cursor: default; opacity: 1; -webkit-text-fill-color: var(--ink-soft); }
.notes textarea:focus { outline: none; }

/* ---------- Edit-mode cues ---------- */

body.editing .tile-name[contenteditable="true"] {
  background: rgba(255,255,255,0.18);
  padding: 2px 5px;
  margin-left: -5px;
  margin-right: -5px;
  cursor: text;
}

body.editing .notes { border-color: var(--aqua); }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--hairline);
  background: rgba(255,255,255,0.6);
  padding: 18px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Motion preference ---------- */

@media (prefers-reduced-motion: reduce) {
  .bar-fill, .tile, .mode-toggle, .save-indicator { transition: none; }
  .unit:hover .tile { transform: none; }
}

/* ---------- Small screens ---------- */

@media (max-width: 720px) {
  :root { --tile: 128px; --notes-w: 88px; }
  .banner { height: 150px; }
  .toolbar, .board { padding-left: 16px; padding-right: 16px; }
  .row { gap: 18px; }
}


/* ---------- Progress color bands ---------- */

.tile.band-mid .tile-name,
.tile.band-mid .pct-value { color: #3A2E08; }
.tile.band-mid .tile-name.placeholder { color: rgba(58, 46, 8, 0.5); }
.tile.band-mid .pct-sign { color: rgba(58, 46, 8, 0.7); }
.tile.band-mid .bar { background: rgba(58, 46, 8, 0.18); }
body.editing .tile.band-mid .tile-name[contenteditable="true"] { background: rgba(255,255,255,0.35); }

.tile.band-high .bar { background: rgba(255,255,255,0.28); }

/* ---------- Edit controls ---------- */

.tile { position: relative; }   /* unclipped so the fold can overhang */

.tile-delete {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  color: var(--white);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.tile-delete:hover { background: rgba(180, 40, 40, 0.85); }
.tile.band-mid .tile-delete { color: #3A2E08; background: rgba(58,46,8,0.16); }
.tile.band-mid .tile-delete:hover { color: var(--white); background: rgba(180,40,40,0.85); }

.chip {
  align-self: center;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed var(--teal);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.chip:hover { background: var(--glass); }
.chip-danger { color: #A33; border-color: #A33; }
.chip-row { align-self: flex-start; margin-left: 2px; }

.row-hint {
  align-self: center;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-soft);
  border: 1px dashed var(--hairline);
  border-radius: var(--radius);
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.55);
}

.unit.dragging { opacity: 0.45; }
body.editing .unit { cursor: grab; }
body.editing .unit:active { cursor: grabbing; }

@media (max-width: 720px) {
  .masthead { padding: 0 18px; }
  .masthead-quote { max-width: 46%; }
}


/* ---------- Folded corner ---------- */

.fold {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 93px;
  height: 93px;
  filter: drop-shadow(-3px -3px 5px rgba(0, 0, 0, 0.28));
  pointer-events: none;
}

.fold-face {
  width: 100%;
  height: 100%;
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
  background-color: #9CCBEA;                    /* default fold color */
  background-size: cover;
  background-position: center;
}

/* ---------- 100% — bright celebratory green ---------- */

.tile.band-done {
  background: linear-gradient(160deg, #57EF91, #22C55E 55%, #12A150) !important;
  border-color: #0E8A43 !important;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.35), 0 10px 28px rgba(34, 197, 94, 0.38);
}
.tile.band-done .bar { background: rgba(255, 255, 255, 0.35); }

/* ---------- Clickable tiles (view mode) ---------- */

.tile.has-link { cursor: pointer; }
.tile.has-link:hover { transform: translateY(-2px); }

/* ---------- Tile column & edit tools ---------- */

.tile-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: var(--tile);
}

.tile-tools {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.link-input {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  padding: 5px 8px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}
.link-input::placeholder { color: #A9C2C6; }

.img-row { display: flex; gap: 5px; }

.mini-btn {
  flex: 1;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 5px 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.mini-btn:hover { background: var(--glass); }
.mini-btn:disabled { opacity: 0.6; cursor: default; }
.mini-danger { color: #A33; flex: 0 0 auto; }
