/* MORSE IA — Analog communications desk. Presentation layer only. */
:root {
  --bg: #142725;
  --white: #e6d7b7;
  --ink: #29291f;
  --muted: #4f4b3b;
  --blue: #294d49;
  --green: #315448;
  --amber: #c69d5f;
  --red: #803d32;
  --line: #b5a586;
  --soft: #d4c5a4;
  --paper: #e6d7b7;
  --copper: #bc9261;
  --ivory: #eaddbf;
  --title-font: 'Courier New', Courier, monospace;
}
body {
  background: linear-gradient(#1023218c, #15211edb), url('../assets/desk.webp') center / cover fixed, #152725;
  color: var(--ivory);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, #cbb78c03 0 1px, transparent 1px 4px);
}
h1,h2,h3,.eyebrow,.section-index,.brand,.mini-signal,.card-index,.draft-message,code,.key-symbols,.credentials {
  font-family: var(--title-font);
}
h1,h2,h3 { letter-spacing: -.025em; }
button { border-color: #70654e; background: #e2d2ae; color: #283d36; border-radius: 3px; box-shadow: 0 2px 0 #7e7156; }
button:hover { background: #efdfbd; }
button:active { background: #d2c19b; box-shadow: none; }
button.primary { background: #2c4b43; border-color: #213e36; color: #f0e5cc; box-shadow: inset 0 1px 0 #ffffff18, 0 3px 0 #122b26; }
button.primary:hover { background: #365c50; }
button:disabled,button.primary:disabled { background: #c8bfa7; color: #5c5b50; border-color: #a0957d; box-shadow: none; }
button.tertiary { box-shadow: none; color: #385449; }
button.danger { color: #76362d; background: #e6cfad; border-color: #915649; }
button.danger:hover { background: #efd0ac; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible,summary:focus-visible { outline-color: #a15d23; }
input,select { border-color: #7f7158; border-radius: 2px; background: #f0e3c8; color: #29291f; }
input[type=checkbox],input[type=radio],input[type=range] { accent-color: #345448; }
input::placeholder { color: #645f50; }
.site-header { background: #152b28ed; border-bottom: 1px solid #9e7b4a; box-shadow: 0 4px 20px #0004; }
.brand { color: #e9daba; box-shadow: none; }
.brand:hover { background: transparent; }
.brand b { color: #c69d5f; }
.brand small { color: #c5b995; font-family: 'Segoe UI',Arial,sans-serif; }
.brand-mark { border-color: #b79760; border-radius: 2px; }
.brand-mark i { background: #c9a96c; }
.nav-button { color: #ded1b4; box-shadow: none; }
.nav-button:hover { background: #d0b58014; }
.teacher-link { border-left-color: #aa8c5b66; }
.site-footer { color: #cabd9c; border-color: #9a81594d; font-family: var(--title-font); }
body[data-view=admin] .student-navigation { display: none; }
.page-head h1 { color: #ede0c0; }
.page-head .eyebrow { color: #c6b58d; }
.head-actions .tertiary { color: #e3d2af; }
.context { border-color: #9a815966; color: #e0d2b3; }
.context strong { color: #eadbb9; }
.panel, .stat, dialog, .help-panel {
  color: #29291f;
  background-color: #e2d2ae;
  background-image: url('../assets/paper-grain.svg'), linear-gradient(120deg,#f0e1bf66,#c8b38a33);
  border-color: #ac956c;
  border-radius: 4px;
  box-shadow: 0 6px 24px #0004, inset 0 0 0 4px #c9b68e44;
}
.panel { position: relative; }
.panel::after {
  content: '';
  pointer-events: none;
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #816b47;
  border: 1px solid #b49a6e;
  top: 7px;
  right: 7px;
}
.receiver { border-top-color: #7a825f; }
.transmitter { border-top-color: #9a6e42; }
.panel .eyebrow, .panel .section-index { color: #655d47; }
.muted,.hint { color: #4f4b3b; }
main > .hint,main > .row > .hint { color: #d0c2a1; }
.badge { color: #334d43; background: #d1d1ad; border: 1px solid #71826866; border-radius: 3px; }
.badge.green { color: #2a4836; background: #cfceaa; }
.badge.amber { color: #654521; background: #e7cd96; border-color: #a57f46; }
.signal-screen {
  background: radial-gradient(ellipse at 50% 0,#41594a55,transparent 80%), #1e342d;
  color: #e3d4ae;
  border: 5px solid #665c45;
  border-radius: 5px;
  box-shadow: inset 0 3px 12px #0006, 0 1px 0 #f7e9c0;
}
.signal-screen .hint,.signal-meta { color: #c6bea1; }
.lamp { border-color: #948a66; background: #252c22; box-shadow: inset 0 2px 4px #0008; }
.lamp.on { background: #ddb56a; border-color: #f2d99b; box-shadow: 0 0 8px #e8b45777; }
.morse-letter.active { background: #c6a05d; outline-color: #f4e4be; color: #1b3029; }
.progress { accent-color: #c8a867; }
.method-option span { background: #d6c6a3; border-color: #918060; border-radius: 2px!important; color: #3c3b2f; }
.method-option input:checked + span { background: #365247; border-color: #263e34; color: #f0e2bf; box-shadow: inset 0 2px 5px #0004; }
.method-option input:focus-visible + span { outline-color: #a15d23; }
.method-hint,.draft-label,.placeholder,.send-reason { color: #554c38; }
.draft-message { background: #f0e2c5; border-color: #ac9971; box-shadow: inset 0 2px 3px #7c674514; border-radius: 2px; }
.candidate { border-color: #ab9670; }
.input-surface { background: #d1c09a; border-color: #8e7a54; border-radius: 4px; box-shadow: inset 0 2px 8px #76654018; }
.input-surface.key-mode { background: #d6c8a6; }
.input-surface.key-mode:focus { outline-color: #a15d23; }
.telegraph { background: radial-gradient(circle at 40% 28%,#49604e,#172c25 75%); color: #eedfbb; border: 7px solid #b39460; box-shadow: 0 0 0 2px #796447,0 5px 0 #655038,0 7px 12px #0004; }
.telegraph:hover { background: radial-gradient(circle at 40% 28%,#5b7056,#213c30 75%); }
.telegraph.is-pressed { background: #bc9251; color: #172b23; border-color: #876637; box-shadow: 0 0 0 2px #796447,0 2px 0 #655038; }
.duration { background: #afa383; }
.duration-fill { background: #6c5932; }
.duration-wrap { color: #645c47; }
.translation { background: #e8dbb7; border: 1px solid #bda67b; border-radius: 2px; }
.error-text { color: #7b3027; }
.details-section { border-color: #ad9976; }
.details-section summary { color: inherit; }
.panel .details-section summary { color: #62563d; }
.inbox li,.log-list li { border-color: #a9936d; }
.inbox button { color: #34372b; background: transparent; box-shadow: none; }
.inbox button[aria-pressed=true] { background: #c7bd96; }
.log-list { color: #e4d5b5; }
.log-list .muted,.log-list .hint { color: #cebc93; }
.banner { color: #453a24; background: #dbc08b; border-color: #a28046; border-radius: 3px; }
.banner.error { background: #dfbd9c; border-color: #8f5340; }
.demo-controls { border-color: #8b7958; color: #e0d2b0; background: #10221db8; border-radius: 3px; }
.demo-controls summary,.demo-controls .hint { color: #cdbd98; }
.operator { background: #cfc09d; border: 1px solid #ac9972; border-radius: 2px; }
.stat b { font-family: var(--title-font); color: #34493a; }
.stat span { color: #625943; }
.admin-tools { color: #dcd0b0; }
.table-wrap { border-color: #a28b60; border-radius: 3px; background: #e1d1af; }
caption { color: #e4d5b3; }
th { background: #304b40; color: #eee1be; font-family: var(--title-font); }
td { color: #393a2d; border-color: #bba67c; }
td button { background: #d7c59f; }
.level-label { color: #5e5541; }
.help-panel { border-left-color: #9f8253; }
.alpha-item { border-color: #b6a075; border-radius: 2px; }
.settings-group { border-color: #ad9976; }
.credentials { background: #d2c39e; color: #344034; }
dialog::backdrop { background: #071814b8; backdrop-filter: blur(3px); }
.calibration-pad { background: #2b4539; color: #eee0ba; }
.calibration-pad.is-pressed { background: #bc9251; color: #172b23; }
.skip { background: #edddba; color: #243e34; }
/* Entry screens are physical paper cards on an operator's desk. */
body.portal-view {
  background: linear-gradient(90deg,#061b1b42,#15251c08 45%,#101f1c50), url('../assets/desk.webp') center / cover fixed, #172826;
}
.portal-view main {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 30px 24px 48px;
  min-height: 100svh;
  display: flex;
  justify-content: center;
}
.portal { width: 100%; max-width: 940px; align-self: center; }
.portal-masthead { text-align: center; margin: 0 auto 44px; color: #e5d6ae; position: relative; }
.portal-masthead h1 {
  font: 700 clamp(2.75rem,5vw,4.5rem)/1.08 var(--title-font);
  letter-spacing: .15em;
  text-shadow: 0 3px 10px #000b;
  margin: 14px 0 10px;
  padding-left: .15em;
}
.portal-masthead h1 span { color: #bca071; }
.masthead-code { color: #c3b087; font: 700 .875rem/1.6 var(--title-font); letter-spacing: .12em; }
.masthead-rule { display: block; width: 86px; height: 1px; margin: auto; background: #bca07188; position: relative; }
.masthead-rule::before,.masthead-rule::after { content: ''; position: absolute; width: 3px; height: 3px; border: 1px solid #bca071; top: -2px; transform: rotate(45deg); }
.masthead-rule::before { left: -8px; }.masthead-rule::after { right: -8px; }
.masthead-rule.lower { margin-top: 16px; width: 170px; opacity: .65; }
.archive-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 54px; max-width: 840px; margin: 0 auto; }
.archive-card {
  --tilt: -.8deg;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 20px 19px 13px;
  border: 1px solid #9c8056;
  border-radius: 2px;
  background: url('../assets/paper-grain.svg'), linear-gradient(120deg,#eddfbf,#d3bd91);
  color: #2c352a;
  text-align: center;
  box-shadow: 0 18px 30px #0008, 2px 3px 0 #806c48, inset 0 0 24px #9c723b25;
  transform: rotate(var(--tilt));
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms;
}
.archive-card:nth-child(2) { --tilt: .8deg; }
.archive-card::before { content: ''; position: absolute; inset: 8px; border: 1px solid #8e775351; pointer-events: none; }
.archive-card:hover { transform: translateY(-4px) rotate(0deg); background: url('../assets/paper-grain.svg'),linear-gradient(120deg,#f3e5c4,#dfc99b); box-shadow: 0 23px 36px #0009,2px 3px 0 #806c48,inset 0 0 24px #9c723b18; border-color: #e0bb78; }
.archive-card:active { transform: translateY(-1px) rotate(0deg); box-shadow: 0 10px 20px #0008; }
.archive-card:focus-visible { outline: 3px solid #eed8a0; outline-offset: 7px; }
.archive-registration { text-align: left; color: #796c50; font: .625rem/1.4 var(--title-font); letter-spacing: .15em; margin: 0 8px 9px; }
.card-fastener { position: absolute; width: 74px; height: 23px; background: #ad9a7399; border: 1px solid #c1b08b6b; left: calc(50% - 37px); top: -12px; transform: rotate(-5deg); box-shadow: 0 2px 3px #0002; }
.archive-card:nth-child(2) .card-fastener { transform: rotate(5deg); }
.archive-picture { display: block; width: 100%; height: 244px; overflow: hidden; background: #cfba91; border: 1px solid #a18c66; position: relative; }
.archive-picture::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 20px #6b4e292e; }
.archive-picture img { display: block; width: 100%; height: 100%; object-fit: cover; filter: sepia(.12) saturate(.7) contrast(.94); mix-blend-mode: multiply; }
.archive-label { display: flex; justify-content: center; align-items: center; min-height: 76px; padding: 16px 5px 8px; font: 700 1.6rem/1.12 var(--title-font); letter-spacing: .045em; }
.portal-experiences .archive-label { font-size: 1.45rem; }
.archive-card-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #95805d7a; color: #726044; padding: 8px 4px 0; font: .875rem/1 var(--title-font); }
.card-arrow { font-family: 'Segoe UI',Arial,sans-serif; font-size: 1.1rem; }
.portal-login { max-width: 460px; }
.portal-login .portal-masthead { margin-bottom: 30px; }
.portal-login .portal-masthead h1 { font-size: 3rem; }
.access-paper { background: url('../assets/paper-grain.svg'),linear-gradient(120deg,#e9d9b5,#d5bf94); color: #2d3428; padding: 28px 34px 20px; border: 1px solid #a58c5f; box-shadow: 0 16px 44px #0008,inset 0 0 0 6px #ac916326; position: relative; }
.paper-corner { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 30% 30%,#d9be84,#75603e); box-shadow: 0 1px 2px #0008; }
.login-role { font: 700 .8125rem/1.4 var(--title-font); letter-spacing: .2em; border-bottom: 1px solid #a68b5e; padding-bottom: 16px; margin-bottom: 22px; text-align: center; color: #5e573e; }
.access-paper .form-stack { gap: 10px; }
.access-paper .field { margin-top: 8px; }
.login-field-label { display: flex; align-items: center; gap: 10px; font: 700 .875rem/1.5 var(--title-font); letter-spacing: .07em; }
.login-field-label svg { width: 18px; height: 18px; fill: none; stroke: #4e5b40; stroke-width: 1.5; }
.access-paper input { width: 100%; background: #eaddbd; border-color: #9a8359; border-bottom: 2px solid #716144; box-shadow: inset 0 2px 4px #6c57321a; }
.access-paper input[aria-invalid=true] { border-color: #803d32; }
.login-submit { width: 100%; margin-top: 12px; font-family: var(--title-font); letter-spacing: .08em; display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; }
.login-demo { text-align: center; font-size: .75rem; color: #51472f; margin: 22px 0 8px; line-height: 1.7; }
.login-demo span { font-family: var(--title-font); font-weight: 700; letter-spacing: .03em; }
.portal-back { border: 0; box-shadow: none; min-height: 44px; padding: 8px 0; color: #51533d; font-size: .8125rem; background: transparent; }
.portal-back:hover { background: transparent; text-decoration: underline; }
@media(min-width:1700px) {
  .archive-cards { max-width: 960px; gap: 70px; }
  .portal { max-width: 1060px; }
  .archive-picture { height: 292px; }
  .archive-label { min-height: 84px; font-size: 1.8rem; }
  .portal-experiences .archive-label { font-size: 1.65rem; }
  .portal-masthead { margin-bottom: 58px; }
  .portal-login { max-width: 460px; }
}
@media(max-width:959px) {
  .table-wrap { background: transparent; }
  tr { background: #e2d2ae; border-color: #aa9369; }
  td::before { color: #675b41; }
  .archive-cards { gap: 28px; max-width: 760px; }
  .archive-picture { height: 218px; }
  .archive-label { font-size: 1.35rem; }
  .portal-experiences .archive-label { font-size: 1.2rem; }
}
@media(max-width:599px) {
  body,body.portal-view { background-attachment: scroll; }
  .portal-view main { padding: 30px 24px 40px; }
  .portal { align-self: flex-start; }
  .portal-masthead { margin-bottom: 34px; }
  .portal-masthead h1 { font-size: 2.6rem; }
  .archive-cards { grid-template-columns: 1fr; gap: 34px; max-width: 360px; }
  .archive-picture { height: 210px; }
  .archive-card { padding: 17px 16px 12px; }
  .archive-label { min-height: 64px; font-size: 1.5rem; }
  .portal-experiences .archive-label { font-size: 1.25rem; }
  .portal-login .portal-masthead h1 { font-size: 2.4rem; }
  .access-paper { padding: 24px 20px 16px; }
  .header-inner { gap: 12px; }
  .site-header nav { gap: 2px; }
  .teacher-link { border-left: 0; }
}
@media(max-height:760px) and (min-width:960px) {
  .portal-view main { padding-top: 24px; padding-bottom: 30px; }
  .portal-masthead { margin-bottom: 32px; }
  .portal-masthead h1 { font-size: 3.5rem; }
  .archive-picture { height: 215px; }
  .archive-label { min-height: 66px; }
  .portal-login .portal-masthead { margin-bottom: 22px; }
  .portal-login .portal-masthead h1 { font-size: 2.5rem; }
}
@media(prefers-reduced-motion:reduce) {
  .archive-card,.archive-card:hover,.archive-card:active { transform: none; transition: none; }
}
.reduce-motion .archive-card,.reduce-motion .archive-card:hover,.reduce-motion .archive-card:active { transform: none; transition: none; }
@media(forced-colors:active) {
  .archive-card,.access-paper { border: 2px solid ButtonText; }
  .archive-picture img { mix-blend-mode: normal; filter: none; }
}
