/* The harbour office: shared premium nautical style for the tide report and the captain's pages
   (body.office-page). Ivory chart paper with gold rules, instruments on a dark chart plate,
   Harbour Serif headings. Loaded after the page's own stylesheet. */

body.office-page{
  --oc-ink:#0b1b2d;--oc-gold:#b8964f;--oc-gold-light:#f2d99b;--oc-ivory:#f7f0e2;--oc-paper:#fbf6ea;
  --oc-navy:linear-gradient(150deg,#06152a 0%,#0b2547 55%,#071a33 100%);
  color:var(--oc-ink);
  background:
    repeating-linear-gradient(0deg,rgba(184,150,79,.06) 0 1px,transparent 1px 64px),
    repeating-linear-gradient(90deg,rgba(184,150,79,.06) 0 1px,transparent 1px 64px),
    radial-gradient(ellipse 80% 50% at 50% 0%,rgba(242,217,155,.35),transparent 70%),
    linear-gradient(180deg,#fbf7ee,#f3ead6)!important;
  background-attachment:fixed!important;
}
body.office-page .footer-copy,body.office-page .footer-tagline{color:rgba(11,27,45,.62)!important;}

.office{position:relative;z-index:2;width:min(1120px,calc(100% - 40px));margin:0 auto;padding:clamp(28px,6vh,64px) 0 30px;}

/* ---------- Head ---------- */
.office-head{display:grid;justify-items:center;text-align:center;margin-bottom:clamp(26px,5vh,46px);}
.office-compass{width:74px;height:74px;padding:0;margin-bottom:16px;border:0;border-radius:50%;background:none;cursor:pointer;filter:drop-shadow(0 12px 24px rgba(7,17,28,.18));transition:transform .5s var(--ease-sail);}
.office-compass:hover{transform:rotate(-12deg) scale(1.05);}
.office-compass:focus-visible{outline:2px solid var(--oc-gold);outline-offset:6px;}
.office-compass svg{width:100%;height:100%;}
.oc-ring{fill:#fffdf8;stroke:#b8964f;stroke-width:2.6;}
.oc-inner{fill:none;stroke:rgba(184,150,79,.4);stroke-width:.8;stroke-dasharray:1.2 2.4;}
.oc-rose{fill:rgba(184,150,79,.22);stroke:rgba(184,150,79,.7);stroke-width:.6;}
.oc-needle{fill:#0b1b2d;}
.oc-jewel{fill:#d4b06a;stroke:#7d5f27;stroke-width:.6;}
.office-kicker{display:flex;align-items:center;gap:14px;margin:0 0 8px;font-size:11px;font-weight:900;letter-spacing:.3em;text-transform:uppercase;color:#9a783b;}
.office-kicker::before,.office-kicker::after{content:"";width:34px;height:1px;background:currentColor;opacity:.55;}
.office-title{margin:0;font:italic 400 clamp(46px,7vw,84px)/1 "Harbour Serif",Georgia,"Times New Roman",serif;letter-spacing:-.03em;color:var(--oc-ink);}
.office-date{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 12px;margin:14px 0 0;font-size:12px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:rgba(11,27,45,.58);}
.office-date i{font-style:normal;color:var(--oc-gold);}
.office-lead{max-width:620px;margin:14px auto 0;font-size:15px;line-height:1.65;color:rgba(11,27,45,.68);}

/* ---------- The dark chart plate ---------- */
.office-plate{
  position:relative;isolation:isolate;overflow:hidden;
  padding:clamp(34px,5vh,52px) clamp(18px,3vw,40px) clamp(28px,4vh,40px);border-radius:26px;color:var(--oc-ivory);
  background:repeating-linear-gradient(0deg,rgba(255,255,255,.03) 0 1px,transparent 1px 48px),repeating-linear-gradient(90deg,rgba(255,255,255,.03) 0 1px,transparent 1px 48px),var(--oc-navy);
  box-shadow:inset 0 0 0 10px #071a33,inset 0 0 0 11px rgba(201,170,106,.55),inset 0 0 0 16px #071a33,inset 0 0 0 17px rgba(201,170,106,.2),0 36px 80px rgba(7,17,28,.22);
}
.office-edge{position:absolute;top:22px;font-size:11px;font-weight:800;letter-spacing:.24em;text-transform:uppercase;color:#c9aa6a;}
.office-edge--tl{left:34px;}
.office-edge--tr{right:34px;font-variant-numeric:tabular-nums;}

/* ---------- Instruments ---------- */
.tide-instruments{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(14px,2.4vw,30px);}
.instrument-card{display:grid;justify-items:center;text-align:center;padding:10px 6px 4px;}
.instrument-card+.instrument-card{border-left:1px solid rgba(201,170,106,.22);}
.instrument-label{margin:0 0 8px;font-size:11px;font-weight:900;letter-spacing:.24em;text-transform:uppercase;color:#c9aa6a;}
.instrument-card svg{width:min(190px,100%);height:auto;overflow:visible;}
.instrument-value{margin:8px 0 0;font:italic 400 clamp(22px,2.4vw,28px)/1.15 "Harbour Serif",Georgia,"Times New Roman",serif;color:var(--oc-ivory);}
.instrument-note{margin:6px 0 0;max-width:260px;font-size:13px;line-height:1.5;color:rgba(247,240,226,.68);}

/* tide clock */
.tc-face{fill:rgba(2,8,18,.45);stroke:url(#none);stroke:#c9aa6a;stroke-width:2.4;}
.tc-water{fill:rgba(90,167,255,.28);stroke:rgba(150,200,255,.5);stroke-width:1;transition:d 1s ease;}
.tc-ticks line{stroke:rgba(242,217,155,.55);stroke-width:1.4;}
.tc-label{fill:#e9cf8f;font:italic 400 13px "Harbour Serif",Georgia,"Times New Roman",serif;text-anchor:middle;}
.tc-hand path{stroke:#f2d99b;stroke-width:3;stroke-linecap:round;}
.tc-hand circle{fill:#f2d99b;}
.tc-hand{transition:transform 1s var(--ease-sail);}
.tc-hub{fill:#d4b06a;stroke:#7d5f27;stroke-width:1;}

/* moon */
.md-halo{fill:rgba(242,217,155,.08);}
.md-dark{fill:#0a1a30;}
.md-lit{fill:#f4ead0;filter:drop-shadow(0 0 16px rgba(255,240,205,.45));}
.md-rim{fill:none;stroke:rgba(242,217,155,.45);stroke-width:1.2;}

/* sun */
.sa-horizon{stroke:#c9aa6a;stroke-width:1.6;}
.sa-path{fill:none;stroke:rgba(242,217,155,.45);stroke-width:1.4;stroke-dasharray:3 6;}
.sa-sun{fill:#ffcf6e;filter:drop-shadow(0 0 12px rgba(255,200,100,.8));transition:cx 1s,cy 1s;}
.sa-sun.is-down{fill:#6f7f99;filter:none;}

/* ---------- Sections on paper ---------- */
.office-notices,.office-routes{margin-top:clamp(30px,5vh,48px);}
.office-section-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:6px 18px;}
.office-section-title{margin:0 0 16px;font:italic 400 clamp(26px,3vw,34px)/1.15 "Harbour Serif",Georgia,"Times New Roman",serif;color:var(--oc-ink);}
.office-section-note{font-size:11px;font-weight:800;letter-spacing:.22em;text-transform:uppercase;color:#9a783b;}

.notices{list-style:none;margin:0;padding:0;border-top:1px solid rgba(184,150,79,.45);}
.notices li{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:18px;padding:16px 6px;border-bottom:1px solid rgba(184,150,79,.3);}
.notice-no{font:italic 400 20px/1 "Harbour Serif",Georgia,serif;color:var(--n);min-width:30px;}
.notice-body{display:grid;gap:3px;}
.notice-body strong{font-size:13px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;}
.notice-body span{font-size:14px;color:rgba(11,27,45,.66);}
.notices a{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;text-decoration:none;color:var(--oc-ink);border:1px solid rgba(184,150,79,.5);background:#fffdf8;transition:transform .25s var(--ease-sail),border-color .25s;}
.notices a:hover{transform:translateX(3px);border-color:var(--n);}

.routes-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr));gap:16px;}
.office-route{
  position:relative;display:grid;gap:6px;padding:22px 20px 18px;border-radius:16px;text-decoration:none;color:var(--oc-ink);
  background:linear-gradient(180deg,#fffdf8,#f8f1e3);border:1px solid rgba(184,150,79,.45);border-top:3px solid var(--route);
  box-shadow:inset 0 0 0 4px #fffdf8,inset 0 0 0 5px rgba(184,150,79,.18),0 14px 30px rgba(7,17,28,.07);
  transition:transform .3s var(--ease-sail),box-shadow .3s ease;
}
.office-route:hover{transform:translateY(-4px);box-shadow:inset 0 0 0 4px #fffdf8,inset 0 0 0 5px rgba(184,150,79,.25),0 22px 44px rgba(7,17,28,.12);}
.office-route:focus-visible{outline:2px solid var(--oc-gold);outline-offset:3px;}
.office-route__label{font-size:11px;font-weight:900;letter-spacing:.22em;text-transform:uppercase;color:#9a783b;}
.office-route__title{font:italic 400 24px/1.15 "Harbour Serif",Georgia,"Times New Roman",serif;}
.office-route__text{font-size:13px;line-height:1.5;color:rgba(11,27,45,.64);}
.office-route__status{display:flex;justify-content:space-between;align-items:center;margin-top:8px;padding-top:10px;border-top:1px dashed rgba(184,150,79,.4);font-size:11px;font-weight:800;letter-spacing:.18em;text-transform:uppercase;color:var(--oc-ink);}
.office-route__status b{font-size:15px;color:#9a783b;transition:transform .25s var(--ease-sail);}
.office-route:hover .office-route__status b{transform:translateX(4px);}

/* ---------- Actions ---------- */
.office-actions{display:flex;justify-content:center;margin-top:clamp(30px,5vh,46px);}
.office-btn{
  display:inline-flex;align-items:center;gap:12px;min-height:50px;padding:0 28px;border-radius:999px;text-decoration:none;
  background:linear-gradient(135deg,#f4dfa6,#c9aa6a 55%,#a9843f);color:#07111c;font-size:12px;font-weight:900;letter-spacing:.18em;text-transform:uppercase;
  box-shadow:0 14px 30px rgba(7,17,28,.18),inset 0 0 0 1px rgba(255,255,255,.35);transition:transform .3s var(--ease-sail);
}
.office-btn:hover{transform:translateY(-2px);}
.office-btn:focus-visible{outline:2px solid var(--oc-ink);outline-offset:4px;}

@media (max-width:820px){
  .tide-instruments{grid-template-columns:1fr;}
  .instrument-card+.instrument-card{border-left:0;border-top:1px solid rgba(201,170,106,.22);padding-top:22px;}
  .instrument-card svg{width:150px;}
  .instrument-card .sun-arc{width:190px;}
  .office-edge--tr{display:none;}
}
@media (max-width:640px){
  .office{width:calc(100% - 28px);}
  .notices li{gap:12px;}
}
@media (prefers-reduced-motion:reduce){.tc-hand,.tc-water,.sa-sun,.office-route,.office-btn,.office-compass{transition:none;}}

/* ---------- Captain's Log: a numbered logbook on paper ---------- */
.office-ledger{max-width:820px;margin:0 auto;padding:clamp(22px,4vh,36px) clamp(18px,4vw,48px);border-radius:6px;
  background:repeating-linear-gradient(180deg,transparent 0 31px,rgba(184,150,79,.14) 31px 32px),linear-gradient(180deg,#fffdf8,#f8f1e3);
  border:1px solid rgba(184,150,79,.5);box-shadow:inset 0 0 0 6px #fffdf8,inset 0 0 0 7px rgba(184,150,79,.25),0 26px 60px rgba(7,17,28,.10);}
.ledger{list-style:none;margin:0;padding:0;}
.ledger-entry{display:grid;grid-template-columns:62px 1fr;gap:18px;padding:18px 0;border-bottom:1px solid rgba(184,150,79,.3);
  opacity:0;transform:translateY(10px);animation:ledgerIn .7s var(--ease-sail) forwards;animation-delay:calc(var(--i) * .09s + .1s);}
.ledger-entry:last-child{border-bottom:0;}
.ledger-no{font:italic 400 34px/1 "Harbour Serif",Georgia,serif;color:var(--entry);border-right:2px solid var(--entry);padding-right:10px;text-align:right;}
.ledger-label{font-size:11px;font-weight:900;letter-spacing:.22em;text-transform:uppercase;color:#9a783b;}
.ledger-body h3{margin:4px 0 6px;font:italic 400 clamp(22px,2.4vw,27px)/1.2 "Harbour Serif",Georgia,"Times New Roman",serif;color:var(--oc-ink);}
.ledger-body p{margin:0;font-size:15px;line-height:1.65;color:rgba(11,27,45,.7);}
@keyframes ledgerIn{to{opacity:1;transform:none}}

/* ---------- Chronometer: the countdown back to the Tide Report ---------- */
.office-chrono{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px 14px;margin:clamp(24px,4vh,36px) auto 0;text-align:center;}
.office-chrono__ring{width:26px;height:26px;border-radius:50%;background:conic-gradient(#b8964f var(--p,0%),rgba(184,150,79,.18) 0);
  -webkit-mask:radial-gradient(circle,transparent 8px,#000 9px);mask:radial-gradient(circle,transparent 8px,#000 9px);animation:chronoFill var(--dur,15s) linear forwards;}
@property --p{syntax:'<percentage>';inherits:false;initial-value:0%;}
@keyframes chronoFill{to{--p:100%}}
body.office-page .office-chrono .seconds-line{margin:0;font-size:11px;font-weight:800;letter-spacing:.2em;text-transform:uppercase;color:rgba(11,27,45,.6);}
body.office-page .office-chrono .seconds-line span{color:var(--oc-ink);font-variant-numeric:tabular-nums;}
body.office-page .office-chrono .final-message{flex-basis:100%;margin:0;font:italic 15px "Harbour Serif",Georgia,serif;color:#7d5f27;opacity:0;transition:opacity .6s;}
body.office-page .office-chrono .final-message.is-visible{opacity:1;}

/* ---------- Dry Dock: the vessel on its keel blocks ---------- */
.dock{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);align-items:center;gap:clamp(18px,3vw,40px);}
.dock-scene{width:100%;height:auto;}
.dock-walls{fill:none;stroke:rgba(201,170,106,.55);stroke-width:2;}
.dock-scaffold path{stroke:rgba(201,170,106,.4);stroke-width:2.4;stroke-dasharray:6 4;}
.dock-mast{stroke:#c9aa6a;stroke-width:3;fill:none;}
.dock-hull{stroke:rgba(242,217,155,.6);stroke-width:1.5;}
.dock-deck{stroke:#e9cf8f;stroke-width:2.5;}
.dock-blocks rect{fill:#5b4421;stroke:#c9aa6a;stroke-width:1;}
.dock-lamp circle{fill:#fff1c4;filter:drop-shadow(0 0 8px #ffd27a);}
.dock-beam{fill:rgba(255,226,160,.16);transform-origin:540px 52px;animation:dockSweep 6s ease-in-out infinite;}
.dock-spark circle{fill:#ffd27a;opacity:0;animation:dockSpark 2.4s ease-out infinite;}
.dock-spark circle:nth-child(2){animation-delay:1.2s;}
@keyframes dockSweep{0%,100%{transform:rotate(-8deg)}50%{transform:rotate(14deg)}}
@keyframes dockSpark{0%{opacity:0;transform:scale(.4)}10%{opacity:1;transform:scale(1.4)}40%,100%{opacity:0}}
.dock-checklist{list-style:none;margin:0;padding:0;display:grid;gap:12px;}
.dock-checklist li{display:flex;align-items:center;gap:12px;font:italic 19px/1.3 "Harbour Serif",Georgia,serif;color:var(--oc-ivory);
  opacity:.35;animation:dockCheck .6s ease forwards;animation-delay:calc(var(--i) * 2.6s + 1.2s);}
.dock-checklist li::before{content:"";flex:0 0 auto;width:20px;height:20px;border-radius:50%;border:1.5px solid #c9aa6a;
  background:radial-gradient(circle,#c9aa6a 0 4px,transparent 5px) center/0 0 no-repeat;transition:background-size .3s;}
@keyframes dockCheck{to{opacity:1}}
.dock-checklist li{--done:0;}
.dock-checklist li::before{animation:dockTick .4s ease forwards;animation-delay:calc(var(--i) * 2.6s + 1.4s);}
@keyframes dockTick{to{background-size:100% 100%;}}

/* ---------- Harbour Status: the bridge ---------- */
.bridge-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:12px;margin-bottom:clamp(20px,3vh,30px);}
.bridge-readout{display:grid;gap:3px;padding:14px 16px;border-radius:12px;border:1px solid rgba(201,170,106,.35);background:rgba(2,8,18,.35);}
.bridge-readout span{font-size:11px;font-weight:900;letter-spacing:.22em;text-transform:uppercase;color:#c9aa6a;}
.bridge-readout strong{font:italic 400 30px/1.1 "Harbour Serif",Georgia,serif;color:var(--c);}
.bridge-readout small{font-size:12px;color:rgba(247,240,226,.62);}
.bridge-gauges{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr));gap:18px;}
.bridge-dial{margin:0;display:grid;justify-items:center;text-align:center;gap:8px;}
.bridge-dial svg{width:min(150px,100%);height:auto;}
.bd-face{fill:url(#none);fill:#081b33;stroke:#c9aa6a;stroke-width:3;filter:drop-shadow(0 8px 16px rgba(0,0,0,.4));}
.bd-track{fill:none;stroke:rgba(255,255,255,.1);stroke-width:5;stroke-linecap:round;}
.bd-value{fill:none;stroke:var(--c);stroke-width:5;stroke-linecap:round;filter:drop-shadow(0 0 4px var(--c));}
.bd-ticks path{stroke:rgba(242,217,155,.55);stroke-width:1.4;}
.bd-needle{transform-box:view-box;transform-origin:60px 60px;transform:rotate(var(--a));animation:bdSettle 1.6s var(--ease-sail);}
.bd-needle path{stroke:#f2d99b;stroke-width:2.6;stroke-linecap:round;}
.bd-hub{fill:#d4b06a;stroke:#7d5f27;}
.bd-num{fill:var(--oc-ivory);font:italic 400 16px "Harbour Serif",Georgia,serif;text-anchor:middle;}
@keyframes bdSettle{from{transform:rotate(-120deg)}}
.bridge-dial figcaption{display:grid;gap:2px;}
.bridge-dial figcaption span{font-size:11px;font-weight:900;letter-spacing:.2em;text-transform:uppercase;color:#c9aa6a;}
.bridge-dial figcaption strong{font:italic 400 19px "Harbour Serif",Georgia,serif;color:var(--oc-ivory);}
.bridge-dial figcaption small{font-size:12px;line-height:1.45;color:rgba(247,240,226,.62);max-width:200px;}
.bridge-systems{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr));gap:16px;}
.bridge-system{display:grid;gap:6px;padding:22px 20px 18px;border-radius:16px;background:linear-gradient(180deg,#fffdf8,#f8f1e3);border:1px solid rgba(184,150,79,.45);border-top:3px solid var(--c);
  box-shadow:inset 0 0 0 4px #fffdf8,inset 0 0 0 5px rgba(184,150,79,.18),0 14px 30px rgba(7,17,28,.07);}
.bridge-system__bar{height:4px;margin-top:6px;border-radius:4px;background:rgba(184,150,79,.2);overflow:hidden;}
.bridge-system__bar i{display:block;height:100%;width:var(--lvl);background:var(--c);border-radius:4px;animation:barIn 1.4s var(--ease-sail);}
@keyframes barIn{from{width:0}}

@media (max-width:820px){.dock{grid-template-columns:1fr;}}
@media (prefers-reduced-motion:reduce){
  .ledger-entry,.dock-checklist li,.dock-checklist li::before{animation:none;opacity:1;transform:none;background-size:100% 100%;}
  .dock-beam,.dock-spark circle,.bd-needle,.bridge-system__bar i{animation:none;}
}
