/*
 * SUBSTRATA / SIGNAL DESK
 * Keep the cryptographic and native bridge flows untouched.
 * Convert the navigation + module index into a readable pirate field console.
 */
:root{
  --sub-paper:#eae2d3;
  --sub-blood:#e84a37;
  --sub-yellow:#e9da55;
}
html{scroll-padding-top:100px}
body{overflow-x:clip}
.console-shell{max-width:1920px}
.masthead{
  background:#120e0c;
  position:relative;
  box-shadow:inset 0 -7px 0 #36231d;
}
.masthead::after{
  content:"";position:absolute;bottom:0;left:0;right:0;height:3px;
  background:repeating-linear-gradient(90deg,var(--coral) 0 64px,#130c08 64px 69px);
  pointer-events:none;
}
.navigation-rail{
  background:
    repeating-linear-gradient(0deg,transparent 0 26px,rgba(255,242,221,.025) 27px),
    #19120f;
}
.rail-eyebrow{color:var(--sub-yellow)}
.rail-link{border-bottom:1px dashed #4a332b}
.rail-link.active{background:var(--sub-yellow);border-left-color:var(--sub-blood);color:#16110e}
.rail-link.active .rail-index{color:#7b261e}
.rail-link:hover:not(.active){background:#41251e}
.mobile-rail-toggle{display:none}
.console-content{
  background:
    repeating-linear-gradient(0deg,rgba(250,220,188,.018) 0 1px,transparent 1px 30px),
    #17110f;
}
.system-notice{
  border-left-color:var(--sub-yellow);
  background:#32221b;
  color:#e4d6c8;
}
.system-notice span{color:var(--sub-yellow)}
.view-hero{
  min-height:420px;
  background:
    repeating-linear-gradient(-4deg,rgba(38,25,18,.045) 0 1px,transparent 1px 19px),
    var(--sub-paper);
  border:0;border-top:13px solid #e84a37;
  box-shadow:9px 10px 0 #080503;
  clip-path:polygon(0 0,100% 0,100% 97%,98% 100%,90% 98%,83% 100%,72% 98%,60% 100%,50% 98%,37% 100%,25% 98%,0 100%);
}
.view-hero::before{
  content:"S/001  -  NO PERMISSION REQUESTED";
  position:absolute;bottom:18px;right:17px;
  color:#ad9585;font:800 8px var(--mono);
  letter-spacing:.04em;transform:rotate(-2deg);
}
.view-hero::after{
  background:var(--sub-yellow);width:220px;height:195px;
  right:-50px;top:-30px;
}
.view-hero h1{
  font-size:clamp(69px,6.6vw,132px);
  letter-spacing:-.047em;
  line-height:.84;
  text-shadow:2px 2px 0 rgba(0,0,0,.12);
}
.view-hero h1 em{background:var(--sub-blood)}
.hero-stamp{border-color:#1c130e;color:#1c130e;top:35px;right:24px}
.metric-band{
  border:0;border-top:5px solid var(--sub-yellow);
  border-bottom:3px solid #615045;
  background:#30241d;
  box-shadow:5px 5px 0 #080603;
}
.metric{border-color:#5a463b;min-height:103px}
.metric strong{color:var(--sub-paper)}
.metric .metric-state{color:var(--sub-yellow)}
.section-title-row{
  border-top:2px dashed #80685b;
  padding-top:17px;
}
.slant-label{color:#22140d}
.module-grid{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:23px;
  padding:10px 6px 42px;
}
.module-card{
  min-height:336px;
  border:0;
  border-top:7px solid #111;
  box-shadow:7px 8px 0 #0a0605;
  clip-path:polygon(0 0,100% 0,100% 98%,96% 100%,79% 99%,63% 100%,45% 99%,30% 100%,17% 99%,0 100%);
}
.module-card:nth-child(1){grid-column:span 7;transform:rotate(-1deg)}
.module-card:nth-child(2){grid-column:span 5;transform:rotate(1.6deg) translateY(25px)}
.module-card:nth-child(3){grid-column:span 5;transform:rotate(-1.1deg) translateY(-7px)}
.module-card:nth-child(4){grid-column:span 7;transform:rotate(.65deg) translateY(13px)}
.module-card:hover{
  transform:translateY(-3px) rotate(0deg);
  box-shadow:9px 12px 0 #090504;
}
.module-card h3{font-size:clamp(43px,4vw,69px);letter-spacing:-.035em}
.module-cta{border-top-width:2px}
.honesty-panel{border-color:#9a806f}
.view-head{border-bottom:5px solid var(--sub-blood)}
.view-head h1{
  font-size:clamp(70px,6.5vw,121px);
  letter-spacing:-.045em;
  text-wrap:balance;
}
.paper-panel,.form-panel,.dark-panel,.list-panel,.preview-paper{box-shadow:5px 6px 0 #080504}
.action-button{min-height:48px}
.action-button:focus-visible,.tiny-button:focus-visible,.rail-link:focus-visible{outline-color:var(--sub-yellow)!important}
.node-step pre,.windows-node-kit pre,.linux-node-kit pre,.native-hook-guide pre{overflow-wrap:anywhere;max-width:100%}
.node-step pre{white-space:pre-wrap}
.fingerprint{overflow-wrap:anywhere;max-width:100%}
textarea,input,select{font-size:16px}
.risk-note{color:#f0e3d6}
.portability-section{margin:58px 0 26px;position:relative}
.portability-head{
  position:relative;padding:27px 30px 26px;
  background:var(--sub-yellow);color:#1b120e;
  border-top:9px solid var(--sub-blood);
  transform:rotate(-.5deg);box-shadow:7px 9px 0 #080503;
}
.portability-head::after{
  content:'TAKE IT WITH YOU / 006';position:absolute;top:21px;right:25px;
  transform:rotate(5deg);border:2px solid #5b2019;padding:9px 11px;
  font:900 10px var(--mono);color:#5b2019;max-width:155px;
}
.portability-head .eyebrow{color:#a12e20}
.portability-head h2{
  margin:12px 0 22px;font:900 clamp(45px,5.5vw,87px)/.84 var(--display);
  max-width:85%;letter-spacing:-.04em;
}
.portability-head h2 em{font-style:normal;color:var(--sub-blood)}
.portability-head p:last-child{font-size:15px;max-width:750px;line-height:1.55;font-weight:650}
.archive-grid{margin-top:27px}
.archive-grid .paper-panel{border-top:6px solid var(--sub-blood)}
.archive-grid .dark-panel{border-top:6px solid var(--sub-yellow)}
.archive-grid .dark-panel code{color:var(--sub-yellow)}
.archive-grid input[type=file]{display:block;width:100%;max-width:100%;color:#eee0d0;font-size:12px}
.archive-grid input[type=file]::file-selector-button{background:var(--sub-paper);color:#27140c;border:0;padding:9px;cursor:pointer}
.device-control{margin-top:45px}
.device-control .section-title-row h2{line-height:.9}
.device-control .paper-panel{border-top:6px solid var(--sub-yellow)}
.device-control .dark-panel{border-top:6px solid var(--sub-blood)}
.storage-readout{
  background:#1d1714;color:var(--sub-yellow);font:900 11px/1.75 var(--mono);
  padding:13px;margin:19px 0;overflow-wrap:anywhere;
}
.erase-panel h3{font:900 clamp(29px,3vw,48px)/1 var(--display);color:var(--sub-paper);margin:14px 0}
.danger-button{color:#dcac96;border-color:#674139}
.danger-button:hover:not(:disabled){background:#b33627;color:#fff;border-color:#b33627}
.record-row .inline-actions{margin-top:0}
.record-row .record-info{min-width:0;overflow-wrap:anywhere}
.file-option #vault-open-archive{display:block;margin-top:16px;max-width:100%;white-space:normal;text-align:left;border-color:#5f4234;color:#6b281e}

@media(max-width:1160px){
  .module-card:nth-child(1),.module-card:nth-child(2),.module-card:nth-child(3),.module-card:nth-child(4){
    grid-column:span 6;
  }
}
@media(max-width:850px){
  html{scroll-padding-top:95px}
  .masthead{min-height:75px}
  .navigation-rail{
    position:sticky;top:0;z-index:45;
    padding:0;border-bottom:4px solid var(--sub-blood);
    box-shadow:0 5px 0 #100907;
  }
  .mobile-rail-toggle{
    display:flex;align-items:center;justify-content:space-between;
    width:100%;min-height:61px;padding:10px 23px;
    border:0;background:#211610;color:var(--sub-paper);
    cursor:pointer;text-align:left;
  }
  .mobile-rail-copy{display:grid;gap:4px}
  .mobile-rail-copy small{font:900 9px/1.2 var(--mono);color:var(--sub-yellow);letter-spacing:.06em}
  .mobile-rail-copy strong{font:900 22px/.95 var(--display);letter-spacing:.02em}
  .mobile-rail-arrow{
    font:900 26px/1 var(--body);width:39px;height:39px;
    display:grid;place-items:center;
    border:2px solid var(--coral);color:var(--coral);
    transition:transform .2s;
  }
  .navigation-rail.rail-open .mobile-rail-arrow{transform:rotate(180deg)}
  .navigation-rail .rail-nav{
    display:none;grid-template-columns:repeat(2,minmax(0,1fr));
    overflow:visible;gap:0;padding:0 8px 11px;
  }
  .navigation-rail.rail-open .rail-nav{display:grid}
  .rail-link,.navigation-rail .rail-link{
    display:grid;grid-template-columns:20px minmax(0,1fr);
    flex:none;padding:14px 10px!important;
    border:1px solid #634339!important;
    min-height:58px;
    font-size:16px!important;
    white-space:normal;overflow-wrap:anywhere;
  }
  .rail-link.active,.navigation-rail .rail-link.active{border-color:var(--sub-yellow)!important}
  .rail-index{font-size:9px}
  .console-content{padding:0 24px 55px}
  .view-head{scroll-margin-top:96px}
  .module-grid{padding-bottom:29px}
  .module-card:nth-child(n){transform:none}
  .module-card:hover{transform:translateY(-2px)}
  .view-hero{min-height:0}
}
@media(max-width:650px){
  .signal-tape{font-size:7px;letter-spacing:0}
  .masthead{min-height:69px;padding:8px 13px}
  .masthead-brand img{width:clamp(125px,39vw,168px)}
  .masthead-status{
    font-size:8px;gap:7px;
    padding:7px 8px;
    max-width:45vw;white-space:normal;text-align:right;
  }
  .mobile-rail-toggle{min-height:56px;padding:8px 14px}
  .mobile-rail-copy strong{font-size:20px}
  .console-content{padding:0 13px 40px}
  .system-notice{font-size:11px;padding:11px 12px}
  .view-hero{padding:35px 17px 42px;box-shadow:5px 6px 0 #080503}
  .view-hero h1{
    font-size:clamp(47px,11vw,76px);
    letter-spacing:-.055em;
    line-height:.9;
    max-width:100%;
    margin:42px 0 22px;
    overflow-wrap:normal;
  }
  .view-hero::after{width:123px;height:114px;right:-26px;top:-23px}
  .hero-stamp{font-size:10px;top:29px;right:9px;border-width:2px;padding:6px}
  .view-hero::before{font-size:7px;right:9px;bottom:10px}
  .hero-controls{display:grid;gap:10px}
  .hero-controls .action-button{width:100%;min-width:0}
  .metric-band{grid-template-columns:repeat(2,minmax(0,1fr));margin:20px 0 38px}
  .metric{padding:14px 10px;min-height:96px}
  .metric span{font-size:9px;line-height:1.45;overflow-wrap:anywhere}
  .metric strong{font-size:clamp(27px,8vw,42px);overflow-wrap:anywhere}
  .metric .metric-state{font-size:clamp(17px,4vw,24px)}
  .section-title-row h2{font-size:43px}
  .module-grid{grid-template-columns:minmax(0,1fr);gap:15px;padding:6px 3px 20px}
  .module-card:nth-child(n){grid-column:1;min-height:270px;padding:20px 20px 21px}
  .module-card h3{font-size:clamp(40px,11vw,56px);margin:24px 0 17px}
  .module-card .module-glyph{font-size:75px}
  .module-card p{font-size:14px;margin-bottom:25px}
  .view-head h1{font-size:clamp(48px,11vw,77px);margin:17px 0 25px;line-height:.91}
  .view-head p:last-child{font-size:15px}
  .paper-panel,.form-panel,.dark-panel,.list-panel,.preview-paper{padding:19px 15px;box-shadow:4px 4px 0 #0a0604}
  .action-button{max-width:100%;overflow-wrap:anywhere}
  .inline-actions .action-button{flex-basis:100%;justify-content:space-between}
  .panel-title{font-size:9px;flex-wrap:wrap;overflow-wrap:anywhere}
  .node-step{grid-template-columns:32px minmax(0,1fr);gap:9px}
  .node-step pre{font-size:10px;line-height:1.7;word-break:break-word}
  .node-step h2{font-size:30px}
  .node-disclosure,.risk-note{overflow-wrap:anywhere}
  .reading-panel,.press-share-panel,.bridge-panel,.windows-node-kit,.linux-node-kit{max-width:100%;min-width:0}
  .windows-node-kit h2,.linux-node-kit h2,.bridge-panel h2{font-size:clamp(38px,10vw,53px)}
  .windows-node-kit .inline-actions,.linux-node-kit .inline-actions{display:grid;grid-template-columns:minmax(0,1fr)}
  .windows-node-kit .inline-actions .action-button,.linux-node-kit .inline-actions .action-button{min-width:0;width:100%}
  .native-inbox-heading{flex-wrap:wrap}
  .toast{max-width:calc(100vw - 20px)}
  .portability-section{margin-top:36px}
  .portability-head{padding:24px 16px 24px;box-shadow:4px 5px 0 #080503;transform:none}
  .portability-head::after{position:static;display:inline-block;transform:rotate(-2deg);font-size:8px;margin-top:8px}
  .portability-head h2{font-size:clamp(42px,10.7vw,61px);max-width:100%;margin:15px 0}
  .portability-head p:last-child{font-size:13px}
  .archive-grid{margin-top:20px}
  .record-row:not(.contact-record){flex-direction:column;align-items:stretch}
  .record-row .inline-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .record-row .inline-actions button{width:100%;min-width:0;white-space:normal}
  .device-control{margin-top:31px}
}
@media(max-width:370px){
  .masthead-status{max-width:36px;border:0;background:transparent;padding:4px}
  .masthead-status #network-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .masthead-status .signal-dot{width:12px;height:12px}
  .view-hero h1{font-size:clamp(43px,11vw,51px)}
  .view-head h1{font-size:clamp(45px,11vw,55px)}
  .mobile-rail-copy strong{font-size:19px}
}
@media(prefers-reduced-motion:reduce){
  .mobile-rail-arrow,.module-card{transition:none}
  .module-card:nth-child(n){transform:none}
}
