/* Marine Survey Writer — "Chart room" house style
 * House DNA: tinted canvas, white cards, colour as accent (never a wash),
 * tonal layering over 1px borders. Navy = ink; teal = action; brass = precision
 * accent; coral = live recording + Grade A only.
 */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/manrope-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/manrope-latin-800-normal.woff2") format("woff2");
}

:root {
  --navy: #0b2239;            /* brand-dark: ink, hero band, rails */
  --navy-2: #14395e;          /* gradient partner */
  --teal: #16849a;            /* brand-action (AA on white) */
  --teal-bright: #2aa7b8;
  --brass: #c9a227;
  --coral: #d64541;           /* live recording + Grade A only */
  --amber: #b97d10;           /* Grade B */
  --slate: #5b7285;           /* Grade C / muted */
  --ink: #12283d;
  --muted: #5b7285;
  --bg: #d8e8f2;
  --bg-gradient:
    radial-gradient(1100px 500px at 85% -10%, rgba(122, 216, 229, 0.32), transparent 60%),
    radial-gradient(900px 480px at -10% 30%, rgba(11, 105, 128, 0.09), transparent 55%),
    linear-gradient(180deg, #e6f1f8 0%, #d9e9f3 55%, #cfe1ee 100%);
  --card: #ffffff;
  --border: rgba(11, 34, 57, 0.1);
  --shadow: 0 6px 24px rgba(11, 34, 57, 0.07);
  --shadow-lift: 0 12px 32px rgba(11, 34, 57, 0.12);
  --radius: 18px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Manrope", var(--font);
}

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

html, body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.serif, h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }

/* ---------- landing ---------- */
.land-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.5rem; position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 16px rgba(11, 34, 57, 0.06);
}
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--navy); }
.brand img { width: 42px; height: 42px; border-radius: 10px; box-shadow: 0 2px 8px rgba(11,34,57,.18); }
.brand strong { font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; }
.land-header nav { display: flex; align-items: center; gap: 1.35rem; }
.land-header nav a { color: var(--muted); font-size: 0.95rem; font-weight: 500; }
.land-header nav a:hover { color: var(--navy); text-decoration: none; }
.land-header nav a.cta {
  color: #fff; background: var(--teal); padding: 0.55rem 1.15rem;
  border-radius: 999px; font-weight: 600;
}
.land-header nav a.cta:hover { background: var(--teal-bright); }

.hero { max-width: 1080px; margin: 0 auto; padding: 4.5rem 1.5rem 3rem; text-align: center; }
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.08; font-weight: 800;
  color: var(--navy); margin-bottom: 1.1rem;
}
.hero h1 em { color: var(--teal); font-style: normal; }
.hero p.lede { color: var(--muted); font-size: 1.18rem; max-width: 42rem; margin: 0 auto 2rem; line-height: 1.65; }
.hero .actions a { display: inline-block; margin: 0.4rem; }

.btn {
  display: inline-block; padding: 0.9rem 1.7rem; border-radius: 999px;
  font-weight: 600; font-size: 1rem; border: none; cursor: pointer; font-family: var(--font);
}
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 6px 18px rgba(22,132,154,.28); }
.btn-primary:hover { background: var(--teal-bright); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.btn-ghost:hover { text-decoration: none; box-shadow: var(--shadow-lift); }

.section { max-width: 1080px; margin: 0 auto; padding: 3.25rem 1.5rem; }
.section > h2 { font-size: 1.9rem; font-weight: 800; color: var(--navy); margin-bottom: 1.75rem; text-align: center; }
.section .kicker {
  display: block; text-align: center; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); margin-bottom: 0.6rem;
}

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.25rem; }

.card {
  background: var(--card); border: 0; border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow); position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card h3 { font-size: 1.08rem; font-weight: 700; color: var(--navy); margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.95rem; line-height: 1.6; }
.step-chip {
  width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center;
  justify-content: center; font-family: var(--font-display); font-weight: 800;
  font-size: 1.15rem; color: var(--teal); background: rgba(42, 167, 184, 0.12);
  margin-bottom: 0.9rem;
}

/* stat band */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.25rem; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; text-align: center; }
.stat-card .big { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; color: var(--navy); }
.stat-card .big em { color: var(--teal); font-style: normal; }
.stat-card p { color: var(--muted); font-size: 0.92rem; margin-top: 0.35rem; line-height: 1.5; }

/* report preview mock */
.report-mock {
  max-width: 640px; margin: 2rem auto 0; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lift); padding: 2rem 2.2rem; text-align: left;
}
.report-mock .rm-head { text-align: center; border-bottom: 2px solid var(--navy); padding-bottom: 0.8rem; margin-bottom: 1rem; }
.report-mock .rm-head strong { font-family: var(--font-display); color: var(--navy); font-size: 1.05rem; }
.report-mock .rm-head span { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }
.report-mock h4 { font-family: var(--font-display); color: var(--navy); font-size: 0.95rem; margin: 0.9rem 0 0.35rem; }
.report-mock p { font-family: Georgia, serif; font-size: 0.88rem; color: #2c3e50; line-height: 1.6; }
.rm-row { display: flex; gap: 0.6rem; align-items: baseline; font-size: 0.82rem; padding: 0.4rem 0; border-bottom: 1px solid #eef2f5; }
.rm-row:last-child { border-bottom: 0; }

.grade {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 0.18rem 0.6rem; border-radius: 999px; white-space: nowrap;
}
.grade-a { background: rgba(214, 69, 65, 0.12); color: var(--coral); }
.grade-b { background: rgba(201, 162, 39, 0.16); color: var(--amber); }
.grade-c { background: rgba(91, 114, 133, 0.14); color: var(--slate); }

/* pricing */
.pricing .card { text-align: center; padding-top: 2rem; }
.price { font-family: var(--font-display); font-size: 2.3rem; font-weight: 800; color: var(--navy); margin: 0.45rem 0; }
.price small { font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.plan-flag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; padding: 0.3rem 0.9rem; border-radius: 999px; white-space: nowrap;
}
.pricing .note { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: 1.5rem; }

/* trust list */
.trust { max-width: 720px; margin: 0 auto; }
.trust li { color: var(--ink); line-height: 2; list-style: none; font-size: 1rem; }
.trust li::before { content: "— "; color: var(--brass); font-weight: 700; }

/* navy closing band */
.band {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  border-radius: var(--radius); max-width: 1080px; margin: 1rem auto 3rem;
  padding: 3rem 2rem; text-align: center; color: #f4f1ea;
}
.band h2 { color: #fff; font-size: 1.7rem; font-weight: 800; margin-bottom: 0.7rem; }
.band p { color: #c9d4de; max-width: 36rem; margin: 0 auto 1.5rem; line-height: 1.6; }
.band .btn-primary { background: var(--teal-bright); }

.land-footer { padding: 2.5rem 1.5rem 3rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
.land-footer a { color: var(--muted); margin: 0 0.5rem; }

/* ---------- app shell ---------- */
.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 1rem; position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 16px rgba(11, 34, 57, 0.06);
}
.app-topbar .brand img { width: 34px; height: 34px; }
.app-topbar .brand strong { font-size: 1rem; }
.app-topbar .tools { display: flex; gap: 1rem; align-items: center; }
.app-topbar .tools a, .app-topbar .tools button {
  background: none; border: none; color: var(--muted); font-size: 0.9rem;
  font-weight: 500; cursor: pointer; font-family: var(--font);
}
.app-topbar .tools a:hover, .app-topbar .tools button:hover { color: var(--teal); }

.view { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 5rem; }
.view h1 { font-size: 1.6rem; font-weight: 800; color: var(--navy); margin-bottom: 1rem; }
.view h2 { font-size: 1.15rem; font-weight: 700; color: var(--navy); margin: 1.6rem 0 0.75rem; }

.greeting { margin-bottom: 0.15rem; }
.tagline { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.25rem; }

.stat-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.8rem; margin-bottom: 1.5rem; }
.stat-chip {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow);
  padding: 0.9rem 1.1rem; display: flex; align-items: center; gap: 0.75rem;
}
.stat-chip .num { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--navy); }
.stat-chip .lbl { color: var(--muted); font-size: 0.78rem; line-height: 1.25; }

.panel {
  background: var(--card); border: 0; border-radius: var(--radius);
  padding: 1.4rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}

label { display: block; font-size: 0.85rem; color: var(--muted); font-weight: 500; margin: 0.75rem 0 0.3rem; }
input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%; padding: 0.72rem 0.85rem; border-radius: 10px;
  border: 1px solid transparent; background: #edf4f9; color: var(--ink);
  font-size: 1rem; font-family: var(--font);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--teal); background: #fff; border-color: transparent;
}
textarea { min-height: 90px; resize: vertical; }

.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); font-size: 0.88rem; }
.error-text { color: var(--coral); font-size: 0.9rem; margin-top: 0.5rem; min-height: 1.2em; }
.ok-text { color: #1e7e4f; font-size: 0.9rem; }

.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  background: var(--card); border: 0; border-radius: var(--radius);
  padding: 1.05rem 1.3rem; margin-bottom: 0.65rem; cursor: pointer;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.list-item::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--teal-bright); border-radius: 5px 0 0 5px;
}
.list-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.list-item .title { font-weight: 600; color: var(--navy); }
.badge {
  font-size: 0.72rem; padding: 0.22rem 0.65rem; border-radius: 999px;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.badge.recording { background: rgba(214, 69, 65, 0.12); color: var(--coral); }
.badge.draft { background: rgba(201, 162, 39, 0.18); color: var(--amber); }
.badge.processing { background: rgba(42, 167, 184, 0.14); color: var(--teal); }
.badge.final { background: rgba(30, 126, 79, 0.14); color: #1e7e4f; }

/* ---------- capture ---------- */
.rec-status { text-align: center; padding: 1.1rem 0 0.4rem; }
.rec-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #b7c6d2; margin-right: 0.5rem; }
.rec-dot.live { background: var(--coral); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
#rec-state-text { font-weight: 600; color: var(--navy); }

.rec-main-btn {
  width: 138px; height: 138px; border-radius: 50%; border: 5px solid var(--teal);
  background: #fff; color: var(--navy); font-size: 1.05rem; font-weight: 700;
  font-family: var(--font-display); cursor: pointer; display: block; margin: 1.2rem auto;
  box-shadow: var(--shadow-lift); transition: transform 0.12s ease;
}
.rec-main-btn:active { transform: scale(0.97); }
.rec-main-btn.live { border-color: var(--coral); background: var(--coral); color: #fff; }
.rec-secondary { display: flex; justify-content: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.rec-secondary .btn { min-width: 130px; }
.rec-secondary .btn:disabled { opacity: 0.45; cursor: default; }

.seg-item {
  background: var(--card); border: 0; border-radius: 14px; box-shadow: var(--shadow);
  padding: 0.95rem 1.15rem; margin-bottom: 0.6rem; position: relative; overflow: hidden;
}
.seg-item::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--teal-bright); border-radius: 5px 0 0 5px;
}
.seg-item strong { color: var(--navy); }
.seg-item .row { justify-content: space-between; }
.seg-item .transcript { color: var(--ink); font-size: 0.93rem; margin-top: 0.4rem; line-height: 1.55; cursor: pointer; }
.seg-item .transcript em { color: var(--muted); }
.seg-item .sync { font-size: 0.78rem; font-weight: 600; }
.sync.confirmed { color: #1e7e4f; }
.sync.uploading, .sync.local { color: var(--amber); }
.sync.failed { color: var(--coral); }
.seg-thumbs { display: flex; gap: 0.4rem; margin-top: 0.55rem; flex-wrap: wrap; }
.seg-thumbs img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; box-shadow: var(--shadow); }

/* ---------- report ---------- */
.report-item {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow);
  padding: 1.1rem 1.3rem; margin-bottom: 0.7rem;
}
.report-item textarea {
  width: 100%; background: #fff; border: 1px solid #e3ebf1; color: #2c3e50;
  font-family: Georgia, serif; font-size: 0.97rem; line-height: 1.6; border-radius: 8px;
}
.report-item textarea:focus { outline: 2px solid var(--teal); }
.report-item .meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; display: flex; gap: 0.9rem; align-items: center; flex-wrap: wrap; }
.report-item audio { height: 30px; max-width: 220px; }

.defect-table {
  width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px;
  overflow: hidden; font-size: 0.9rem; box-shadow: var(--shadow);
}
.defect-table th, .defect-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid #eef2f5; text-align: left; vertical-align: top; }
.defect-table th {
  background: var(--navy); color: #fff; font-size: 0.78rem;
  font-family: var(--font-display); letter-spacing: 0.05em; text-transform: uppercase;
}
.defect-table tr:last-child td { border-bottom: 0; }

.footer-note { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 1rem; }

@media (max-width: 640px) {
  .land-header nav a:not(.cta) { display: none; }
  .rec-main-btn { width: 152px; height: 152px; }
  .report-mock { padding: 1.4rem 1.2rem; }
}
