/* tides.watch website. Dark sea theme shared with the watch app and store art. */
:root {
  --bg: #040c13;
  --sea-1: #08202f;
  --sea-2: #0f3550;
  --card: rgba(18, 44, 63, 0.72);
  --card-line: rgba(102, 213, 255, 0.14);
  --ink: #e9f3fa;
  --dim: #9db9cc;
  --faint: #6f8ea2;
  --cyan: #66d5ff;
  --amber: #ffc677;
  --low: #4aa3f0;
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(120% 90% at 80% -10%, var(--sea-2) 0%, var(--sea-1) 40%, var(--bg) 100%) fixed;
  background-color: var(--bg);
  line-height: 1.5;
}
a { color: var(--cyan); }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 20px; letter-spacing: -0.2px; white-space: nowrap; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { text-decoration: none; color: var(--dim); padding: 8px 12px; border-radius: 999px; font-size: 15px; white-space: nowrap; }
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); background: rgba(102, 213, 255, 0.1); }

/* Hero and search */
.hero { padding: 36px 0 18px; }
.hero h1 { font-size: clamp(34px, 7vw, 58px); line-height: 1.05; margin: 0 0 12px; letter-spacing: -1px; }
.hero h1 span { color: var(--cyan); }
.hero p { margin: 0 0 22px; color: var(--dim); font-size: clamp(16px, 2.6vw, 19px); max-width: 560px; }

.search { position: relative; max-width: 560px; }
.search-row { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; height: 52px; padding: 0 18px; border-radius: 14px;
  border: 1px solid var(--card-line); background: rgba(4, 12, 19, 0.6); font-size: 17px; outline: none;
}
.search input:focus { border-color: var(--cyan); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 18px;
  border-radius: 14px; border: 1px solid var(--card-line); background: rgba(102, 213, 255, 0.12); color: var(--ink);
  cursor: pointer; text-decoration: none; font-weight: 600; white-space: nowrap; font-size: 16px;
}
.btn:hover { background: rgba(102, 213, 255, 0.2); }
.btn.primary { background: var(--cyan); color: #04202f; border-color: transparent; }
.btn.small { height: 40px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.results {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: #0b2232; border: 1px solid var(--card-line); border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.5);
}
.results li a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.results li a:hover, .results li a:focus { background: rgba(102, 213, 255, 0.12); outline: none; }
.results small { color: var(--faint); }
.hint { color: var(--faint); font-size: 14px; margin-top: 10px; }

/* Cards and grids */
.section { padding: 22px 0; }
.section h2 { font-size: 20px; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; padding: 8px 14px; border-radius: 999px; background: rgba(102, 213, 255, 0.1); color: var(--ink); text-decoration: none; font-size: 15px; border: 1px solid var(--card-line); }
.chip:hover { background: rgba(102, 213, 255, 0.2); }
.spots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.spots h3 { margin: 0 0 10px; font-size: 15px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; }
.spots ul { list-style: none; margin: 0; padding: 0; }
.spots li a { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(102, 213, 255, 0.08); color: var(--ink); text-decoration: none; }
.spots li a span { color: var(--faint); font-size: 14px; }
.spots li:last-child a { border-bottom: 0; }

.promo { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; text-decoration: none; color: var(--ink); }
.promo img { width: 120px; height: 120px; border-radius: 50%; box-shadow: 0 0 0 6px #1b2a36, 0 0 0 8px #3a4d5c; }
.promo h3 { margin: 0 0 4px; font-size: 19px; }
.promo p { margin: 0; color: var(--dim); }

/* Tide view */
.place { padding: 22px 0 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.place h1 { margin: 0; font-size: clamp(28px, 6vw, 44px); line-height: 1.1; letter-spacing: -0.5px; }
.place p { margin: 4px 0 0; color: var(--dim); }
.place-actions { display: flex; gap: 8px; flex-shrink: 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--card-line); background: rgba(102, 213, 255, 0.08); cursor: pointer; display: grid; place-items: center; font-size: 20px; }
.icon-btn[aria-pressed="true"] { color: var(--amber); }

.now { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.big .label { color: var(--dim); font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; font-size: 14px; }
.big .time { font-size: clamp(56px, 13vw, 92px); font-weight: 300; line-height: 1; margin: 8px 0 6px; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.big .sub { color: var(--dim); font-size: 17px; }
.pair { display: grid; gap: 14px; }
.mini .label { font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.mini .time { font-size: 32px; font-weight: 400; font-variant-numeric: tabular-nums; }
.mini .time small { font-size: 16px; color: var(--dim); margin-left: 6px; }
.mini.light .label { color: var(--amber); }

.chart-card { margin-top: 14px; padding: 12px 6px 6px; overflow: hidden; }
.chart-card h2 { margin: 4px 12px 0; font-size: 16px; color: var(--dim); font-weight: 600; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart text { font-family: var(--font); }

.days { margin-top: 14px; display: grid; gap: 10px; }
.day { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: start; padding: 12px 16px; }
.day h3 { margin: 2px 0 0; font-size: 15px; }
.day h3 small { display: block; color: var(--faint); font-weight: 400; }
.day ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; }
.day li { font-variant-numeric: tabular-nums; }
.day li b { font-weight: 600; }
.day li.past { opacity: 0.45; }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 6px; margin-right: 6px; font-weight: 700; letter-spacing: 0.5px; }
.tag.high { background: rgba(102, 213, 255, 0.16); color: var(--cyan); }
.tag.low { background: rgba(74, 163, 240, 0.14); color: #8ec4f7; }

.note { color: var(--faint); font-size: 13px; margin-top: 16px; }
.notice { margin-top: 14px; padding: 12px 16px; border-radius: 14px; background: rgba(255, 198, 119, 0.1); border: 1px solid rgba(255, 198, 119, 0.25); color: var(--ink); }
.loading { color: var(--dim); padding: 40px 0; }

/* Garmin page */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; align-items: center; }
.split > * { min-width: 0; }
.watch-frame { border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 12px #1b2a36, 0 0 0 15px #3a4d5c, 0 30px 70px rgba(0,0,0,.55); width: min(360px, 78vw); aspect-ratio: 1; margin: 18px auto; }
.watch-frame img { width: 100%; height: 100%; object-fit: cover; }
.shots img { width: 100%; height: auto; aspect-ratio: 1; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.features .card h3 { margin: 0 0 6px; font-size: 17px; }
.features .card p { margin: 0; color: var(--dim); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.shots img { border-radius: 50%; box-shadow: 0 0 0 6px #1b2a36, 0 0 0 8px #3a4d5c; }
video { width: 100%; border-radius: var(--radius); border: 1px solid var(--card-line); background: #000; }
.watch-list { columns: 2; color: var(--dim); padding-left: 18px; }
.status { display: inline-block; padding: 6px 12px; border-radius: 999px; background: rgba(255, 198, 119, 0.12); color: var(--amber); font-weight: 600; font-size: 14px; }

.prose { max-width: 720px; }
.prose h2 { margin-top: 28px; font-size: 20px; }
.prose p, .prose li { color: var(--dim); }

/* Footer */
.foot { padding: 30px 0 40px; color: var(--faint); font-size: 14px; border-top: 1px solid rgba(102, 213, 255, 0.08); margin-top: 30px; }
.foot a { color: var(--dim); }
.foot p { margin: 4px 0; }

@media (max-width: 640px) {
  .now { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .day { grid-template-columns: 1fr; }
  .nav a { padding: 7px 9px; font-size: 14px; }
  .brand { font-size: 18px; gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .btn.small { height: 34px; padding: 0 10px; font-size: 14px; }
  .promo { grid-template-columns: 84px 1fr; }
  .promo img { width: 84px; height: 84px; }
  .watch-list { columns: 1; }
}
/* Very narrow phones (320-360 px, e.g. iPhone SE 1st gen): stack header and search. */
@media (max-width: 360px) {
  .top { flex-wrap: wrap; row-gap: 6px; }
  .nav { width: 100%; margin-left: -9px; }
  .search-row { flex-wrap: wrap; }
  .search input { flex: 1 1 100%; }
  #locate { flex: 1 1 100%; }
  .place { flex-direction: column; }
}
@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fade 0.35s ease-out both; }
  @keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* "Tides where I am" is the main action; search sits underneath. */
.big-locate { width: 100%; max-width: 560px; height: 62px; font-size: 19px; border-radius: 16px; box-shadow: 0 12px 30px rgba(102, 213, 255, 0.18); }
.big-locate:disabled { opacity: 0.7; cursor: progress; }
.or { display: block; color: var(--dim); font-size: 14px; margin: 22px 0 8px; }
.locating { color: var(--dim); padding: 50px 0; text-align: center; font-size: 18px; }

.hint .btn { margin-top: 10px; }
