/* Aira Tide Trace — track support (polished UI) */
:root {
  --tt-ink: #0f2f3a;
  --tt-deep: #16485a;
  --tt-sea: #1f7a8c;
  --tt-foam: #b8f2e6;
  --tt-coral: #e85a3c;
  --tt-sand: #eef5f4;
  --tt-line: rgba(15, 47, 58, 0.12);
  --tt-mute: rgba(15, 47, 58, 0.58);
  --tt-display: "Bitter", Georgia, serif;
  --tt-sans: "Sofia Sans", "Segoe UI", sans-serif;
  --tt-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tt-shadow: 0 22px 50px rgba(15, 47, 58, 0.13);
}

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

body.aira-tide {
  margin: 0;
  min-height: 100%;
  color: var(--tt-ink);
  font-family: var(--tt-sans);
  background: var(--tt-sand);
  -webkit-font-smoothing: antialiased;
}

body.aira-tide .aira-bare-main {
  min-height: 100vh;
  padding: 0 !important;
  max-width: none !important;
  width: 100%;
  display: block;
}

.tt-shore {
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  padding-bottom: 1.5rem;
}

.tt-waves {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(68% 52% at 92% 8%, rgba(184, 242, 230, 0.4), transparent 55%),
    radial-gradient(58% 48% at 6% 82%, rgba(31, 122, 140, 0.14), transparent 50%),
    linear-gradient(165deg, #e6f2f1 0%, var(--tt-sand) 48%, #e1eeeb 100%);
}

.tt-wave {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 26vh;
  border-radius: 58% 42% 52% 48%;
  opacity: 0.26;
  filter: blur(2px);
  animation: tt-swell 12s ease-in-out infinite alternate;
}

.tt-wave-a {
  bottom: -8vh;
  background: rgba(31, 122, 140, 0.32);
}

.tt-wave-b {
  bottom: -2vh;
  background: rgba(184, 242, 230, 0.5);
  animation-delay: -3s;
  animation-duration: 15s;
}

.tt-wave-c {
  bottom: 6vh;
  background: rgba(232, 90, 60, 0.1);
  animation-delay: -7s;
  animation-duration: 18s;
}

.tt-top,
.tt-dash,
.tt-foot {
  position: relative;
  z-index: 1;
}

.tt-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.75rem);
}

.tt-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--tt-ink);
  font-family: var(--tt-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  justify-self: start;
}

.tt-seal {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 18%;
  background: var(--tt-ink);
  color: var(--tt-foam);
  font-family: var(--tt-sans);
  font-size: 0.95rem;
  font-weight: 800;
  transition: transform 0.32s var(--tt-ease), background 0.28s ease;
}

.tt-brand:hover .tt-seal {
  transform: rotate(-12deg) scale(1.05);
  background: var(--tt-deep);
}

.tt-top-tag {
  margin: 0;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tt-mute);
}

.tt-top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  justify-self: end;
  justify-content: end;
}

.tt-top-nav a {
  color: var(--tt-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.08rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tt-top-nav a:hover {
  color: var(--tt-coral);
  border-bottom-color: var(--tt-coral);
}

.tt-dash {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 1.1rem;
  align-items: stretch;
  padding: 0.25rem clamp(1rem, 4vw, 2.75rem) 1.35rem;
  width: min(1100px, 100%);
  margin: 0 auto;
  flex: 1;
}

.tt-kicker {
  margin: 0 0 0.3rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tt-sea);
}

.tt-buoy {
  position: relative;
  padding: clamp(1.3rem, 3vw, 1.8rem);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 1.35rem 1.35rem 1.85rem 1.35rem;
  box-shadow: var(--tt-shadow);
  backdrop-filter: blur(14px);
  animation: tt-rise 0.65s var(--tt-ease) both;
}

.tt-buoy::before {
  content: "";
  position: absolute;
  top: 1rem;
  right: 1.05rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--tt-foam) 45%, var(--tt-sea));
  box-shadow: 0 0 0 6px rgba(184, 242, 230, 0.32);
  animation: tt-beacon 2.4s ease-in-out infinite;
}

.tt-brand-hero {
  margin: 0 0 0.55rem;
  font-family: var(--tt-display);
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.92;
  color: var(--tt-ink);
  max-width: 8ch;
}

.tt-buoy h1 {
  margin: 0 0 0.5rem;
  font-family: var(--tt-display);
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.tt-buoy-lede {
  margin: 0 0 1.15rem;
  color: var(--tt-mute);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 36ch;
}

.tt-field {
  display: grid;
  gap: 0.32rem;
  margin-bottom: 0.8rem;
}

.tt-field > span {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tt-mute);
}

.tt-field input {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.72rem 0.95rem;
  border: 1px solid var(--tt-line);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 16px;
  color: var(--tt-ink);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s var(--tt-ease);
}

@media (min-width: 480px) {
  .tt-field input {
    font-size: inherit;
  }
}

.tt-field input:focus {
  outline: none;
  border-color: var(--tt-sea);
  box-shadow: 0 0 0 4px rgba(31, 122, 140, 0.14);
  transform: translateY(-1px);
}

.tt-cast {
  position: relative;
  overflow: hidden;
  appearance: none;
  border: 0;
  width: 100%;
  min-height: 3rem;
  margin-top: 0.3rem;
  border-radius: 0.7rem;
  background: linear-gradient(120deg, var(--tt-ink), var(--tt-deep));
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 47, 58, 0.2);
  transition: transform 0.25s var(--tt-ease), filter 0.25s ease;
}

.tt-cast:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.tt-buoy.is-casting .tt-cast {
  filter: brightness(0.95);
}

.tt-cast-ripple {
  position: absolute;
  inset: auto auto 30% 20%;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgba(184, 242, 230, 0.55);
  animation: tt-ripple 2.2s ease-out infinite;
  pointer-events: none;
}

.tt-board {
  padding: clamp(1.15rem, 2.8vw, 1.6rem);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 1.35rem;
  box-shadow: var(--tt-shadow);
  backdrop-filter: blur(12px);
  animation: tt-rise 0.65s var(--tt-ease) 0.06s both;
  display: grid;
  gap: 1.05rem;
  align-content: start;
}

.tt-board-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.tt-board-head h2 {
  margin: 0;
  font-family: var(--tt-display);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  letter-spacing: -0.03em;
}

.tt-state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0.25rem 0.65rem;
  border-radius: 0.45rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: rgba(15, 47, 58, 0.08);
  color: var(--tt-ink);
}

.tt-shore[data-state="hit"] .tt-state-chip {
  background: rgba(184, 242, 230, 0.65);
  color: var(--tt-deep);
}

.tt-shore[data-state="miss"] .tt-state-chip {
  background: rgba(232, 90, 60, 0.14);
  color: #9a2f1a;
}

.tt-gauges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.tt-gauge {
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  text-align: center;
}

.tt-tube {
  position: relative;
  width: 2.95rem;
  height: 6.9rem;
  border-radius: 1.1rem;
  border: 1px solid var(--tt-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(232, 244, 243, 0.9));
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.tt-liquid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tt-level, 0%);
  background: linear-gradient(180deg, var(--tt-foam), var(--tt-sea));
  transition: height 1.05s var(--tt-ease);
}

.tt-foam {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: calc(var(--tt-level, 0%) - 0.32rem);
  height: 0.65rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  opacity: 0;
  transition: bottom 1.05s var(--tt-ease), opacity 0.35s ease;
}

.tt-gauge.is-full .tt-liquid,
.tt-gauge.is-rising .tt-liquid {
  animation: tt-fill 1.15s var(--tt-ease) both;
}

.tt-gauge.is-full .tt-foam,
.tt-gauge.is-rising .tt-foam {
  opacity: 1;
}

.tt-gauge.is-rising .tt-tube {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 0 0 3px rgba(232, 90, 60, 0.14);
}

.tt-gauge.is-rising .tt-liquid {
  background: linear-gradient(180deg, #ffd0c2, var(--tt-coral));
}

.tt-gauge-copy strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tt-gauge-copy small {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.7rem;
  color: var(--tt-mute);
  line-height: 1.3;
}

.tt-hit {
  padding: 0.95rem 1rem 1.05rem;
  border-radius: 1rem;
  background: linear-gradient(160deg, rgba(184, 242, 230, 0.32), rgba(31, 122, 140, 0.08));
  border: 1px solid rgba(31, 122, 140, 0.18);
  animation: tt-rise 0.4s var(--tt-ease) both;
}

.tt-hit-id {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.8rem;
  margin-bottom: 0.8rem;
}

.tt-hit-id span {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tt-sea);
}

.tt-hit-id strong {
  font-family: var(--tt-display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.tt-hit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.95rem;
}

.tt-hit-grid > div {
  padding: 0.65rem 0.75rem;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--tt-line);
}

.tt-hit-grid > .tt-hit-wide {
  grid-column: 1 / -1;
}

.tt-hit-grid span {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tt-mute);
  margin-bottom: 0.18rem;
}

.tt-hit-grid strong {
  font-size: 0.94rem;
  font-weight: 750;
  word-break: break-word;
}

.tt-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.6rem 1.1rem;
  border-radius: 0.65rem;
  background: var(--tt-ink);
  color: var(--tt-foam);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.9rem;
  transition: transform 0.25s var(--tt-ease), background 0.22s ease;
}

.tt-open:hover {
  transform: translateY(-2px);
  background: var(--tt-deep);
}

.tt-miss,
.tt-idle {
  padding: 0.95rem 1rem;
  border-radius: 0.9rem;
  border: 1px dashed rgba(15, 47, 58, 0.2);
  background: rgba(255, 255, 255, 0.55);
}

.tt-miss {
  border-color: rgba(232, 90, 60, 0.32);
  background: rgba(232, 90, 60, 0.08);
}

.tt-miss p,
.tt-idle p {
  margin: 0 0 0.3rem;
  font-family: var(--tt-display);
  font-size: 1.12rem;
}

.tt-miss span,
.tt-idle span {
  color: var(--tt-mute);
  font-size: 0.9rem;
  line-height: 1.45;
}

.tt-foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.2rem;
  width: min(1100px, calc(100% - 2rem));
  margin-inline: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--tt-line);
  font-size: 0.82rem;
  color: var(--tt-mute);
}

.tt-foot p {
  margin: 0;
}

.tt-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.tt-foot a {
  color: var(--tt-ink);
  font-weight: 750;
  text-decoration: none;
}

.tt-foot a:hover {
  color: var(--tt-coral);
}

@keyframes tt-swell {
  from {
    transform: translate3d(0, 0, 0) scaleX(1);
  }
  to {
    transform: translate3d(2%, -2%, 0) scaleX(1.03);
  }
}

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

@keyframes tt-beacon {
  0%,
  100% {
    box-shadow: 0 0 0 6px rgba(184, 242, 230, 0.28);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(184, 242, 230, 0.12);
  }
}

@keyframes tt-ripple {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(18);
    opacity: 0;
  }
}

@keyframes tt-fill {
  from {
    height: 0%;
  }
}

@media (max-width: 900px) {
  .tt-top {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 0.7rem;
  }

  .tt-top-tag {
    text-align: left;
    justify-self: start;
  }

  .tt-top-nav {
    justify-self: start;
    justify-content: start;
  }

  .tt-dash {
    grid-template-columns: 1fr;
  }

  .tt-brand-hero {
    max-width: none;
  }

  .tt-gauges {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tt-tube {
    height: 5.6rem;
  }
}

@media (max-width: 520px) {
  .tt-hit-grid {
    grid-template-columns: 1fr;
  }

  .tt-buoy,
  .tt-board {
    border-radius: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tt-wave,
  .tt-buoy,
  .tt-board,
  .tt-buoy::before,
  .tt-cast-ripple,
  .tt-liquid,
  .tt-hit {
    animation: none !important;
  }

  .tt-buoy,
  .tt-board {
    opacity: 1;
    transform: none;
  }

  .tt-liquid {
    transition: none;
  }
}
