/* berattastan.com — ship design workbench.
   Landing: the sea and the ship fill the window. Tools: a tinted L-frame and a white sheet (framed-sheet style).
   Colour lives on the data: signal red is the main series and the ship's mark; navy is ink. */
:root {
  --bg: #dfe3e4;            /* sea mist, the 3D clear colour */
  --frame: #e5e9ea;         /* the L-frame, a steel tint */
  --sheet: #fbfcfc;
  --well: #f2f4f5;          /* inputs and the 3D box sit one step down */
  --edge: #dfe3e5;          /* sheet edge and table rules */
  --ink: #0f1d2a;
  --muted: #4d5b67;
  --accent: #b3122c;        /* chart 1, the load line red */
  --chart-2: #0f1d2a;
  --chart-3: #2c6e8a;
  --pass: #1d7348;
  --fail: #b3122c;
  --font: "Schibsted Grotesk", system-ui, sans-serif;
  --r: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, fieldset, figure, dl, dd { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; cursor: grab; }
#scene:active { cursor: grabbing; }
.home, .app { z-index: 1; }
/* on tool screens the canvas lies over the app, transparent except the viewport box; the box underneath takes the pointer */
body[data-view="app"] #scene { z-index: 2; pointer-events: none; }
.viewport { cursor: grab; touch-action: none; }

.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 800; font-size: 17px; letter-spacing: -0.03em; text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.brand circle { fill: none; stroke: var(--accent); stroke-width: 5; }
.brand rect { fill: var(--accent); }

/* ---------------- landing: one glass panel on the sea ---------------- */
.home { position: fixed; inset: 0; pointer-events: none; display: grid; grid-template-columns: minmax(0, 40rem) 1fr; grid-template-rows: auto 1fr auto; padding: clamp(1rem, 2.4vw, 2.25rem); gap: 1.25rem; }
.home > * { pointer-events: auto; }
.home-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.home .brand { font-size: 18px; }
.sound { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(15, 29, 42, 0.14); background: rgba(251, 252, 252, 0.6); backdrop-filter: blur(8px); cursor: pointer; display: grid; place-items: center; transition: transform 200ms var(--ease), background-color 200ms ease; }
.sound:hover { transform: scale(1.08); }
.sound svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound svg path:first-child { fill: var(--ink); }
.sound.off .w { opacity: 0.15; } .sound.off { background: rgba(251, 252, 252, 0.35); }
.hero { grid-row: 2; align-self: center; position: relative; padding: clamp(1.25rem, 2.6vw, 2.25rem); border-radius: 26px; background: rgba(251, 252, 252, 0.74); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: 0 30px 80px -30px rgba(15, 29, 42, 0.45), 0 2px 0 rgba(255, 255, 255, 0.8) inset; transition: transform 500ms var(--ease); transform-style: preserve-3d; will-change: transform; }
.hero::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(420px circle at var(--mx, 30%) var(--my, 0%), rgba(255, 255, 255, 0.65), transparent 60%); mix-blend-mode: soft-light; }
.home h1 { font-size: clamp(2.5rem, 1rem + 4vw, 4.6rem); line-height: 0.92; letter-spacing: -0.055em; font-weight: 800; }
.home h1 .ln { display: inline-block; } .home h1 .red { color: var(--accent); }
.hero-lead { margin-top: 0.9rem; font-size: clamp(0.98rem, 0.9rem + 0.3vw, 1.12rem); max-width: 46ch; color: var(--muted); }
.start { margin-top: 1.4rem; display: grid; gap: 1.1rem; }
.types { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.type { position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 6px 9px; border-radius: 16px; border: 1px solid rgba(15, 29, 42, 0.1); background: rgba(255, 255, 255, 0.55); cursor: pointer; text-align: center; font-size: 12.5px; font-weight: 700; line-height: 1.15;
  transition: transform 260ms var(--ease), background-color 200ms ease, border-color 200ms ease, box-shadow 260ms var(--ease); }
.type input { position: absolute; opacity: 0; pointer-events: none; }
.type svg { width: 100%; max-width: 92px; height: auto; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; transition: transform 400ms var(--ease); }
.type svg .h { fill: var(--ink); stroke: none; }
.type:hover { background: #fff; } .type:hover svg { transform: translateX(4px); }
.type:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 14px 30px -14px rgba(15, 29, 42, 0.7); }
.type:has(input:checked) svg { stroke: #fff; } .type:has(input:checked) svg .h { fill: var(--accent); }
.type:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slide { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 8px; }
.slide .k { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--muted); }
.slide .v { font-size: clamp(1.7rem, 1.2rem + 1.2vw, 2.3rem); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.slide .u { color: var(--muted); font-weight: 600; font-size: 13px; }
.slide input[type="range"] { grid-column: 1 / -1; -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; cursor: pointer; margin: 2px 0 0; }
.slide input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), rgba(15, 29, 42, 0.14) var(--p, 50%)); }
.slide input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: rgba(15, 29, 42, 0.14); }
.slide input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--accent); }
.slide input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-shadow: 0 4px 12px rgba(15, 29, 42, 0.3); transition: transform 160ms var(--ease); }
.slide input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.slide input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.25); }
.preview { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); min-height: 1.4em; }
.preview b { color: var(--ink); font-variant-numeric: tabular-nums; }
.start-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.start .go { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 22px 0 28px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; cursor: pointer;
  box-shadow: 0 16px 34px -14px rgba(179, 18, 44, 0.8); transition: transform 220ms var(--ease), box-shadow 220ms var(--ease); }
.start .go svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 300ms var(--ease); }
.start .go:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -14px rgba(179, 18, 44, 0.9); } .start .go:hover svg { transform: translateX(4px); }
.start .go:active { transform: translateY(0) scale(0.98); }
.start .go::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%); transform: translateX(-100%); animation: sheen 3.6s 1.6s var(--ease) infinite; }
@keyframes sheen { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.start-row a { font-size: 14px; font-weight: 700; }
.tools { grid-row: 3; grid-column: 1; align-self: end; justify-self: start; border-radius: 16px; background: rgba(251, 252, 252, 0.55); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.6); }
.tools summary { cursor: pointer; padding: 10px 16px; font-size: 14px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
.tools summary::-webkit-details-marker { display: none; }
.tools summary::after { content: "+"; font-size: 18px; line-height: 1; color: var(--accent); transition: transform 260ms var(--ease); }
.tools[open] summary::after { transform: rotate(45deg); }
.launch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 0 6px 8px; }
.launch a { display: grid; padding: 0.55rem 0.8rem; text-decoration: none; border-radius: 12px; transition: background-color 220ms ease, transform 260ms var(--ease); }
.launch a:hover, .launch a:focus-visible { background: var(--sheet); transform: translateY(-2px); }
.l-name { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.l-desc { color: var(--muted); font-size: 12.5px; }
body[data-view="app"] .home, body[data-view="studio"] .home { display: none; }
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 30; }
body.launching .hero { transform: perspective(900px) translateZ(-120px) rotateX(8deg) !important; opacity: 0; transition: transform 520ms var(--ease), opacity 420ms ease; }

/* entrance: the panel rises, the title words climb in one after another, the cards follow */
.js .home-top, .js .tools { animation: rise 900ms var(--ease) both; }
.js .hero { animation: rise 900ms var(--ease) backwards; }   /* backwards: after the entrance the tilt owns the transform */
.js .hero { animation-delay: 80ms; } .js .tools { animation-delay: 600ms; }
.js .home h1 .ln { animation: word 900ms var(--ease) both; }
.js .home h1 .ln:nth-child(1) { animation-delay: 220ms; } .js .home h1 .ln:nth-child(2) { animation-delay: 320ms; } .js .home h1 .ln:nth-child(3) { animation-delay: 420ms; }
.js .hero-lead { animation: rise 800ms 480ms var(--ease) both; }
.js .type { animation: pop 700ms var(--ease) backwards; }
.js .type:nth-child(1) { animation-delay: 540ms; } .js .type:nth-child(2) { animation-delay: 600ms; } .js .type:nth-child(3) { animation-delay: 660ms; } .js .type:nth-child(4) { animation-delay: 720ms; } .js .type:nth-child(5) { animation-delay: 780ms; }
.js .sliders, .js .preview, .js .start-row { animation: rise 800ms 860ms var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes word { from { opacity: 0; transform: translateY(0.5em) rotate(4deg); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.92); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .home { grid-template-columns: minmax(0, 36rem) 1fr; }
}
@media (max-width: 760px) {
  .home { grid-template-columns: 1fr; grid-template-rows: auto 30vh auto auto; padding: 16px; gap: 12px; overflow: auto; pointer-events: auto; }
  .home h1 { font-size: 2.4rem; } .hero-lead { font-size: 0.95rem; }
  .hero { grid-row: 3; align-self: start; border-radius: 22px; padding: 18px; }
  .tools { grid-row: 4; justify-self: stretch; }
  .types { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .type { font-size: 11.5px; white-space: nowrap; }
  .sliders { grid-template-columns: 1fr; }
  .launch { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .js .home *, .start .go::after { animation: none !important; } }
/* ---------------- app shell ---------------- */
.app { position: fixed; inset: 0; display: grid; grid-template-columns: 228px 1fr; grid-template-rows: 48px 1fr; pointer-events: none; }
.app > * { pointer-events: auto; }
.app[hidden] { display: none; }
.side { grid-row: 1 / 3; background: var(--frame); padding: 14px 14px 18px 18px; display: flex; flex-direction: column; gap: 1.5rem; }
.side .brand { height: 20px; margin-top: 0; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { text-decoration: none; padding: 0.45rem 0.7rem; border-radius: 8px; color: var(--muted); font-weight: 600; transition: background-color 160ms ease, color 160ms ease; }
.side-nav a:hover { color: var(--ink); background: rgba(15, 29, 42, 0.05); }
.side-nav a[aria-current="page"] { color: var(--ink); background: rgba(15, 29, 42, 0.08); }
.side-note { margin-top: auto; color: var(--muted); font-size: 13px; }
.top { background: var(--frame); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 16px 0 24px; }
.crumb { color: var(--muted); font-size: 14px; }
.crumb a { text-decoration: none; } .crumb a:hover { color: var(--ink); }
#crumb-tool { color: var(--ink); font-weight: 600; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.ghost, .primary, .preset select { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid #cfd6d9; background: var(--sheet); cursor: pointer; font-size: 14px; font-weight: 600; transition: background-color 160ms ease, transform 120ms var(--ease); }
.ghost:hover, .preset select:hover { background: #fff; }
.primary { background: var(--ink); color: var(--sheet); border-color: var(--ink); }
.primary:hover { background: #1f3346; }
.ghost:active, .primary:active { transform: scale(0.97); }
.sheet { grid-column: 2; grid-row: 2; margin: 0 8px 8px 0; background: var(--sheet); border: 1px solid var(--edge); border-radius: var(--r); overflow: auto; }
body[data-view="app"] { overflow: hidden; }

/* ---------------- a tool on the sheet ---------------- */
.tool { display: grid; grid-template-columns: minmax(300px, 340px) minmax(0, 1fr); gap: 0; min-height: 100%; }
.inputs { border-right: 1px solid var(--edge); padding: 20px 20px 32px 24px; display: grid; gap: 22px; align-content: start; }
.inputs h1 { font-size: 22px; letter-spacing: -0.03em; font-weight: 800; line-height: 1.15; }
.inputs .lead { color: var(--muted); font-size: 14px; margin-top: 4px; }
.group { display: grid; gap: 8px; }
.group legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; padding: 0; }
.field { display: grid; grid-template-columns: 1fr 132px; align-items: center; gap: 10px; }
.field label { font-size: 14px; }
.field label small { color: var(--muted); font-size: 13px; }
.unit-in { position: relative; display: flex; align-items: center; }
.unit-in input, .unit-in select { width: 100%; height: 34px; padding: 0 2.6rem 0 0.6rem; border: 1px solid var(--edge); border-radius: 8px; background: var(--well); font-variant-numeric: tabular-nums; text-align: right; }
.unit-in select { padding-right: 0.6rem; text-align: left; }
.unit-in input:focus { background: #fff; border-color: var(--accent); outline: none; }
.unit-in .u { position: absolute; right: 0.6rem; color: var(--muted); font-size: 13px; pointer-events: none; }
.field.bad input { border-color: var(--fail); }
.field .err { grid-column: 1 / -1; color: var(--fail); font-size: 13px; }
.field.text { grid-template-columns: 1fr minmax(0, 1.4fr); } .field.text .unit-in input { padding-right: 0.6rem; text-align: left; }
.check { display: flex; gap: 0.5rem; align-items: center; font-size: 14px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--well); border: 1px solid var(--edge); border-radius: 8px; padding: 2px; }
.seg button { height: 30px; border: 1px solid transparent; background: none; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); border-color: var(--edge); }

.results { padding: 20px 24px 40px; display: grid; gap: 24px; align-content: start; min-width: 0; }
.finding { font-size: 22px; line-height: 1.25; letter-spacing: -0.025em; font-weight: 600; max-width: 52ch; }
.finding .warn { display: block; margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--fail); letter-spacing: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 18px 24px; }
.kpi dt { font-size: 13px; color: var(--muted); }
.kpi dd { font-size: 28px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi dd small { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-left: 0.2rem; }
.kpi.main dd { color: var(--accent); }
.results { container-type: inline-size; }
.viz { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); gap: 16px; }
@container (max-width: 760px) { .viz, .row2 { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--edge); border-radius: 12px; padding: 14px 16px 10px; min-width: 0; }
.panel h2 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.viewport { border-radius: 12px; min-height: 300px; position: relative; background: transparent; }
.viewport-cap { position: absolute; left: 12px; bottom: 10px; font-size: 13px; color: var(--muted); pointer-events: none; }
.chart { width: 100%; display: block; }
.chart text { font-family: var(--font); font-size: 12px; fill: var(--muted); }
.chart .grid line { stroke: #e9ecee; }
.chart .axis line, .chart .axis path { stroke: #c9d1d5; }
.chart .lbl { font-size: 12px; font-weight: 600; }
.chart .hover line { stroke: #9aa7ad; stroke-dasharray: 3 3; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--sheet); font-size: 13px; padding: 6px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity 120ms ease; font-variant-numeric: tabular-nums; }
.chart-wrap { position: relative; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th { text-align: right; font-weight: 600; color: var(--muted); font-size: 13px; padding: 6px 10px; border-bottom: 1px solid var(--edge); white-space: nowrap; }
table.data td { text-align: right; padding: 6px 10px; border-bottom: 1px solid #eef1f2; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data tr.hl td { background: #fbeef0; }
table.data td.pass { color: var(--pass); font-weight: 600; } table.data td.fail { color: var(--fail); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.method { color: var(--muted); font-size: 13px; max-width: 80ch; }
.method p + p { margin-top: 0.4rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.verdict { font-weight: 600; } .verdict.pass { color: var(--pass); } .verdict.fail { color: var(--fail); }
.btn-inline { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: var(--sheet); font-weight: 600; cursor: pointer; font-size: 14px; }
.btn-inline:active { transform: scale(0.97); }
.gz-table { display: grid; grid-template-columns: 1fr 1fr 28px; gap: 6px; align-items: center; }
.gz-table input { height: 32px; width: 100%; border: 1px solid var(--edge); border-radius: 6px; background: var(--well); text-align: right; padding: 0 0.5rem; font-variant-numeric: tabular-nums; }
.gz-table .h { font-size: 13px; color: var(--muted); }
.gz-table button { height: 28px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; }
.gz-table button:hover { background: var(--well); color: var(--fail); }

/* tool entrance: parts arrive in order */
.js .results > *, .js .inputs > *:not(:first-child) { animation: rise 600ms var(--ease) both; }
.js .results > *:nth-child(2) { animation-delay: 50ms; } .js .results > *:nth-child(3) { animation-delay: 100ms; }
.js .results > *:nth-child(4) { animation-delay: 150ms; } .js .results > *:nth-child(5) { animation-delay: 200ms; }

/* ---------------- phone ---------------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 48px 1fr; }
  .side { grid-row: 1; flex-direction: column; align-items: stretch; gap: 0.6rem; padding: 12px 16px 8px; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side-nav a { white-space: nowrap; }
  .side-note { display: none; }
  .top { grid-row: 2; padding: 0 12px; }
  .crumb { display: none; }
  .top-actions { width: 100%; }
  .top-actions .preset { flex: 1; min-width: 0; } .preset select { width: 100%; }
  .ghost, .primary { white-space: nowrap; padding: 0 10px; }
  .sheet { grid-column: 1; grid-row: 3; margin: 0; border-radius: 0; border: 0; }
  .tool { grid-template-columns: 1fr; }
  .inputs { border-right: 0; border-bottom: 1px solid var(--edge); }
  .viz, .row2 { grid-template-columns: 1fr; }
  .viewport { min-height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .home *, .js .results > *, .js .inputs > * { animation: none !important; }
  .launch a, .launch a::after { transition: none; }
}

/* ---------------- landing start form ---------------- */
.start[hidden], body[data-view="app"] .start, body[data-view="studio"] .start, body[data-view="studio"] .home { display: none; }

/* ---------------- design studio (dark) ---------------- */
.project { position: fixed; inset: 0; z-index: 1; --cy: #5fd4e6; --rd: #ff4d63; --bg: #09141e; --sheet: #0f1f2c; --well: #132838; --edge: #1f3a4d; --ink: #e6f0f5; --muted: #8fa7b6; --accent: #ff4d63; --chart-2: #e6f0f5; --chart-3: #5fd4e6; --pass: #4fd1a1; --fail: #ff6b7d; color: var(--ink); }
.project[hidden] { display: none; }
body[data-view="studio"] #scene { z-index: 2; pointer-events: none; }
.studio { height: 100%; display: grid; grid-template-columns: 300px minmax(0, 1fr) 440px; grid-template-rows: 52px 1fr; background: var(--bg); }
.st-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--edge); }
.st-name { flex: 1; max-width: 26rem; height: 34px; background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--ink); font-weight: 600; padding: 0 8px; }
.st-name:hover, .st-name:focus { border-color: var(--edge); outline: none; }
.st-actions { margin-left: auto; display: flex; gap: 6px; }
.st-btn { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--edge); background: var(--well); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.st-btn:hover { border-color: var(--cy); }
.st-primary { background: var(--rd); border-color: var(--rd); color: #fff; }
.st-side { border-right: 1px solid var(--edge); padding: 12px; overflow: auto; }
.spiral { width: 100%; height: auto; }
.spiral .ring { transition: transform 700ms var(--ease); transform-origin: 0 0; }
.spiral .seg path { fill: #132838; stroke: var(--bg); stroke-width: 2; cursor: pointer; transition: fill 300ms ease; }
.spiral .seg.done path { fill: #1d6f80; } .spiral .seg.on path { fill: var(--rd); } .spiral .seg:hover path { fill: #24506a; }
.spiral .seg text { fill: var(--muted); font-size: 10px; font-weight: 600; transition: transform 700ms var(--ease); }
.spiral .seg.on text { fill: var(--ink); }
.spiral .seg .num { fill: var(--ink); font-size: 11px; }
.spiral .c1 { fill: var(--muted); font-size: 12px; } .spiral .c2 { fill: var(--ink); font-size: 15px; font-weight: 800; }
.st-steps { margin: 8px 0 0; padding-left: 1.4rem; display: grid; gap: 2px; color: var(--muted); font-size: 14px; }
.st-steps button { background: none; border: 0; color: inherit; cursor: pointer; padding: 3px 0; text-align: left; }
.st-steps li.on { color: var(--ink); font-weight: 700; }
.st-main { position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.st-tabs { display: flex; gap: 4px; padding: 10px 12px; }
.st-tabs { flex: none; }
.st-hud dd { font-size: 15px !important; }
.st-tabs button { white-space: nowrap; height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--edge); background: none; color: var(--muted); cursor: pointer; font-weight: 600; }
.st-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--cy); }
.st-vp, .st-lines, .st-sac { margin: 0 12px 12px; border-radius: 14px; min-height: 0; }
.st-vp { cursor: grab; touch-action: none; }
.st-lines, .st-sac { background: var(--sheet); padding: 16px; overflow: auto; }
.st-lines[hidden], .st-sac[hidden], .st-vp[hidden], .st-dwgview[hidden] { display: none; }
.st-dwgview { margin: 0 12px 12px; border-radius: 14px; min-height: 0; display: grid; grid-template-rows: auto 1fr; background: #0b1823; border: 1px solid var(--edge); overflow: hidden; }
.st-dwgbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px; border-bottom: 1px solid var(--edge); }
.st-dwgbar > button:not(.st-btn) { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--edge); background: none; color: var(--muted); font-weight: 700; cursor: pointer; }
.st-dwgbar > button[aria-pressed="true"] { color: #fff; background: var(--rd); border-color: var(--rd); }
.st-dwghint { margin-left: auto; color: var(--muted); font-size: 12px; }
.st-dwgcanvas { min-height: 0; cursor: grab; touch-action: none; display: grid; }
.st-dwgcanvas:active { cursor: grabbing; }
.st-dwgcanvas .dwg { max-height: none; height: 100%; width: 100%; }
.st-dwg { cursor: zoom-in; transition: border-color 200ms ease; } .st-dwg:hover { border-color: var(--cy); }
.lines-svg { width: 100%; height: auto; }
.lines-svg polyline { fill: none; vector-effect: non-scaling-stroke; stroke-width: 1; }
.l-prof { stroke: var(--ink); stroke-width: 1.6 !important; } .l-st { stroke: #3a5a70; } .l-wl { stroke: var(--cy); } .l-bt { stroke: #9be28a; } .l-sec { stroke: var(--rd); }
.st-bar { display: flex; align-items: center; gap: 16px; padding-right: 16px; min-width: 0; }
.st-hud { display: flex; gap: 14px; margin: 0 0 0 auto; justify-content: flex-end; overflow: hidden; }
.st-hud div { white-space: nowrap; }
@media (max-width: 1500px) { .st-hud div:nth-child(4), .st-hud div:nth-child(5) { display: none; } }
.st-hud dt { font-size: 11px; color: var(--muted); } .st-hud dd { margin: 0; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.st-hud small { font-weight: 600; color: var(--muted); font-size: 11px; }
.st-panel { border-left: 1px solid var(--edge); overflow: auto; padding: 18px 20px 40px; background: var(--sheet); display: grid; gap: 16px; align-content: start; container-type: inline-size; }
.st-panel h1 { font-size: 24px; letter-spacing: -0.03em; margin: 0; }
.st-panel { overflow-x: hidden; }
.st-panel .kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.st-panel .kpi dd { font-size: 22px; white-space: normal; overflow-wrap: anywhere; }
.st-kicker { color: var(--cy); font-size: 13px; font-weight: 700; margin: 0; }
.st-lead, .st-note { color: var(--muted); font-size: 14px; margin: 0; }
.st-body, .st-results { display: grid; gap: 16px; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chips button { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--edge); background: none; color: var(--muted); cursor: pointer; font-weight: 600; }
.st-chips button[aria-checked="true"] { color: #fff; background: var(--rd); border-color: var(--rd); }
.st-paste { tab-size: 16; white-space: pre; overflow-x: auto; width: 100%; background: var(--well); color: var(--ink); border: 1px solid var(--edge); border-radius: 8px; padding: 8px; font: inherit; font-size: 13px; }
.st-warn { border: 1px solid #6b2a35; background: #2a1219; border-radius: 10px; padding: 10px 12px; font-size: 14px; display: grid; gap: 4px; }
.st-warn p { margin: 0; }
.st-verdict { font-weight: 700; margin: 0; } .st-verdict.pass { color: var(--pass); } .st-verdict.fail { color: var(--fail); }
.st-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.st-outs { display: grid; gap: 8px; }
.st-out { text-align: left; display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--edge); background: var(--well); color: var(--ink); cursor: pointer; }
.st-out:hover { border-color: var(--cy); } .st-out span { color: var(--muted); font-size: 13px; }
.project .panel { border-color: var(--edge); }
.project table.data td { border-color: var(--edge); } .project table.data tr.hl td { background: #2a1219; }
.project .chart .grid line { stroke: #1a3344; } .project .chart .axis line { stroke: #2b4a5e; }
.project .unit-in input, .project .unit-in select { background: var(--well); color: var(--ink); border-color: var(--edge); }
.project .unit-in input:focus, .project .unit-in select:focus, .project .st-paste:focus { background: #0b1823; border-color: var(--cy); outline: none; box-shadow: 0 0 0 3px rgba(95, 212, 230, 0.15); }
.st-spin { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 14px; cursor: pointer; color: #fff; border: 0; background: linear-gradient(120deg, #c4243d, #ff4d63 55%, #ff8a6b); box-shadow: 0 16px 34px -18px rgba(255, 77, 99, 0.9); transition: transform 240ms var(--ease), box-shadow 240ms ease; }
.st-spin b { font-size: 17px; } .st-spin span { font-size: 13px; opacity: 0.9; }
.st-spin:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -16px rgba(255, 77, 99, 1); }
/* drawings (sketch → SVG), the load line mark, notation, checklist */
.st-dwg { background: #0b1823; border: 1px solid var(--edge); border-radius: 10px; padding: 8px; overflow: auto; }
.dwg { width: 100%; height: auto; display: block; max-height: 70vh; }
.dwg polyline, .dwg polygon, .dwg line, .dwg rect, .dwg circle { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.dwg .fill { stroke: none; }
.dwg .d-HULL { stroke: var(--ink); } .dwg .d-STRUCT { stroke: #4f7a94; } .dwg .d-MACHINERY { stroke: var(--cy); } .dwg .d-SHAFT { stroke: var(--rd); }
.dwg .d-TANKS { stroke: #9be28a; } .dwg .d-DIM { stroke: #c9a24f; } .dwg .d-MARK { stroke: var(--rd); }
.dwg .fill.d-STRUCT { fill: #6b97b2; } .dwg .fill.d-SHAFT { fill: var(--rd); } .dwg .fill.d-MARK { fill: var(--rd); }
.dwg circle.d-MARK { stroke: var(--rd); vector-effect: none; }
.dwg text { fill: var(--muted); stroke: none !important; font-family: inherit; } .dwg text.d-MARK { fill: var(--rd); font-weight: 800; } .dwg text.d-DIM { fill: #c9a24f; }
.plimsoll { width: 100%; height: auto; max-height: 420px; }
.plimsoll .pm { fill: var(--rd); } .plimsoll .pring { fill: none; stroke: var(--rd); stroke-width: 25; }
.plimsoll .pt { fill: var(--ink); font-size: 60px; font-weight: 700; } .plimsoll .pt.sm { font-size: 42px; fill: var(--muted); font-weight: 600; } .plimsoll .pt.big { font-size: 115px; fill: var(--rd); font-weight: 800; }
.plimsoll .pdim { stroke: #c9a24f; stroke-width: 6; fill: none; }
.st-notation { display: grid; gap: 4px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--edge); background: linear-gradient(135deg, #132838, #0f1f2c); }
.st-notation small { color: var(--muted); } .st-notation b { font-size: 20px; letter-spacing: 0.02em; } .st-notation span { color: var(--cy); font-weight: 700; }
.st-row { display: flex; gap: 8px; }
.st-h2 { font-size: 16px; margin: 8px 0 0; }
.st-score { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--well); border: 1px solid var(--edge); }
.st-score b { font-size: 34px; letter-spacing: -0.04em; color: var(--pass); font-variant-numeric: tabular-nums; } .st-score span { color: var(--muted); font-size: 13px; }
.st-check h2 { font-size: 13px; color: var(--cy); text-transform: none; margin: 4px 0 6px; }
.st-check ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.st-check button { width: 100%; display: grid; grid-template-columns: 14px 1fr; column-gap: 10px; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--ink); cursor: pointer; }
.st-check button:hover { border-color: var(--edge); background: var(--well); }
.st-check i { grid-row: span 2; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--pass); box-shadow: 0 0 10px var(--pass); }
.st-check .warn i { background: #f2c14e; box-shadow: 0 0 10px #f2c14e; } .st-check .todo i { background: var(--fail); box-shadow: 0 0 10px var(--fail); }
.st-check b { font-size: 14px; font-weight: 600; } .st-check span { color: var(--muted); font-size: 12px; }
/* studio motion: the new step slides in piece by piece, the active segment glows, a sonar sweep turns in the core */
.st-panel.enter > * { animation: stIn 620ms var(--ease) backwards; }
.st-panel.enter > *:nth-child(2) { animation-delay: 40ms; } .st-panel.enter > *:nth-child(3) { animation-delay: 90ms; } .st-panel.enter > *:nth-child(4) { animation-delay: 150ms; } .st-panel.enter > *:nth-child(5) { animation-delay: 210ms; }
.st-panel.enter .st-results > * { animation: stIn 700ms var(--ease) backwards; }
.st-panel.enter .st-results > *:nth-child(2) { animation-delay: 220ms; } .st-panel.enter .st-results > *:nth-child(3) { animation-delay: 280ms; } .st-panel.enter .st-results > *:nth-child(4) { animation-delay: 340ms; } .st-panel.enter .st-results > *:nth-child(n+5) { animation-delay: 400ms; }
@keyframes stIn { from { opacity: 0; transform: translateX(26px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.spiral .seg.on path { filter: drop-shadow(0 0 8px rgba(255, 77, 99, 0.9)); animation: glow 2.4s ease-in-out infinite; }
.spiral .seg.done path { filter: drop-shadow(0 0 4px rgba(95, 212, 230, 0.45)); }
@keyframes glow { 50% { filter: drop-shadow(0 0 14px rgba(255, 77, 99, 1)); } }
.spiral .sweep { animation: sweep 4s linear infinite; transform-origin: 0 0; pointer-events: none; }
.spiral .sweep path { fill: rgba(95, 212, 230, 0.16); }
@keyframes sweep { to { transform: rotate(360deg); } }
.st-out, .project .kpi { position: relative; transition: transform 420ms var(--ease), border-color 200ms ease, box-shadow 300ms ease; transform-style: preserve-3d; }
.st-out::after, .project .kpi::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 260ms ease; background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(95, 212, 230, 0.18), transparent 65%); }
.st-out:hover::after, .project .kpi:hover::after { opacity: 1; }
.st-out:hover { box-shadow: 0 18px 40px -20px rgba(95, 212, 230, 0.6); }
.project .kpi { border-radius: 12px; }
.st-verdict.pass::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pass); box-shadow: 0 0 10px var(--pass); margin-right: 8px; vertical-align: middle; animation: blink 2s ease-in-out infinite; }
.st-verdict.fail::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fail); box-shadow: 0 0 10px var(--fail); margin-right: 8px; vertical-align: middle; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.studio { position: relative; background-color: var(--bg); background-image: linear-gradient(rgba(95, 212, 230, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(95, 212, 230, 0.035) 1px, transparent 1px); background-size: 32px 32px; }
.st-top { position: relative; z-index: 1; } .st-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--cy), var(--rd), transparent); opacity: 0.6; }
@media (prefers-reduced-motion: reduce) { .st-panel.enter *, .spiral .sweep, .spiral .seg.on path, .st-verdict::before { animation: none !important; } }
@media (max-width: 1100px) { .studio { grid-template-columns: 1fr; grid-template-rows: auto auto 60vh auto; overflow: auto; height: auto; } .st-top { flex-wrap: wrap; padding: 8px 12px; gap: 8px; } .st-name { order: 3; flex-basis: 100%; max-width: none; } .st-actions { margin-left: auto; } .st-actions .st-btn { height: 30px; padding: 0 9px; font-size: 13px; } .st-bar { flex-wrap: wrap; gap: 6px; padding: 0 0 6px; } .st-tabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; } .st-hud { margin: 0 12px; flex-wrap: wrap; gap: 6px 12px; justify-content: flex-start; } .st-hud div { display: block !important; } .st-dwghint { display: none; } .project { overflow: auto; } .st-side { display: grid; grid-template-columns: 200px 1fr; } .st-panel { border-left: 0; } .st-actions { flex-wrap: wrap; } }

/* ---------------- report (print) ---------------- */
@media print {
  #scene, .home, .side, .top, .viewport, .no-print { display: none !important; }
  body, html { background: #fff; overflow: visible; height: auto; }
  .app { position: static; display: block; }
  .sheet { border: 0; margin: 0; overflow: visible; }
  .tool { display: block; }
  .inputs { border: 0; padding: 0 0 12px; grid-template-columns: repeat(3, 1fr); display: grid; }
  .inputs input, .inputs select { border: 0; background: none; }
  .results { padding: 0; }
  .viz { grid-template-columns: 1fr; }
  .panel { break-inside: avoid; }
  .js .results > *, .js .inputs > * { animation: none; }
}
