/* Kayo prototypes: shared styles for the client site and the admin.
   Tokens follow the Kayo Digital design system: navy ink, teal actions,
   yellow/orange accents, sharp corners, underline inputs, no shadows. */

@font-face { font-family: 'Metropolis'; src: url('fonts/Metropolis-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Metropolis'; src: url('fonts/Metropolis-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Metropolis'; src: url('fonts/Metropolis-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('fonts/PlayfairDisplay-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }

:root {
  --navy: #182031;
  --navy-2: #242B3B;
  --teal: #009D92;
  --teal-dark: #00857C;
  --yellow: #F4BD49;
  --orange: #ED6B40;
  --page: #F6F8FB;
  --alt: #EBEBEA;
  --white: #ffffff;
  --border: #D9D9D9;
  --ink: #424856;
  --muted: #6B717C;
  --error: #B3261E;
  --error-bg: #FBEAE8;
  --success-bg: #E3F4F2;
  --divider-dark: #3A414E;

  --sans: 'Metropolis', Helvetica, Arial, sans-serif;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --container: 1140px;
  --gutter: 40px;
  --t: 0.3s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
h1, h2, h3 { color: var(--navy); font-weight: 600; line-height: 1.2; margin: 0 0 10px; }
h1 { font-size: clamp(30px, 4vw, 40px); }
h2 { font-size: clamp(22px, 2.6vw, 26px); }
h3 { font-size: 19px; }
p { margin: 0 0 10px; }
a { color: var(--teal); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--orange); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
code { font-size: .92em; background: var(--alt); padding: 1px 6px; overflow-wrap: anywhere; }
.serif { font-family: var(--serif); font-weight: 400; }
.eyebrow { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; font-weight: 600; color: var(--teal); margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 640px) { :root { --gutter: 16px; } body { font-size: 16px; } }

/* ---- Header / footer ---- */
.site-header { background: var(--navy); color: var(--white); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 16px; color: var(--white); }
.brand:hover { color: var(--white); }
.brand img { display: block; height: 34px; width: auto; }
.brand-label { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; font-weight: 600; color: var(--yellow); padding-left: 16px; border-left: 1px solid var(--divider-dark); }
.header-meta { display: flex; align-items: center; gap: 18px; font-size: 15px; color: #C9CDD4; }
.header-meta form { margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--white); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; transition: color var(--t); }
.link-button:hover { color: var(--yellow); }

.site-footer { background: var(--navy); color: #A4A9B2; font-size: 14px; margin-top: 80px; }
.site-footer .container { padding-top: 26px; padding-bottom: 26px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--yellow); }

/* ---- Masthead (navy band with noodles) ---- */
.masthead { position: relative; overflow: hidden; background: var(--navy); color: var(--white); padding: 60px 0 70px; }
.masthead h1 { color: var(--white); font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5vw, 54px); max-width: 16ch; }
.masthead p { color: #C9CDD4; max-width: 56ch; font-size: 18px; }
.masthead .eyebrow { color: var(--yellow); }
.masthead .container { position: relative; z-index: 1; }
.noodles { position: absolute; right: -40px; top: -40px; height: calc(100% + 80px); width: auto; opacity: .9; pointer-events: none; }
@media (max-width: 760px) { .noodles { opacity: .25; right: -160px; } }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 47px; padding: 10px 24px; border: 2px solid var(--teal); border-radius: 0;
  background: var(--teal); color: var(--white); font: 600 16px/1.2 var(--sans);
  cursor: pointer; text-align: center; transition: background var(--t), border-color var(--t), color var(--t);
}
.btn:hover { background: var(--navy); border-color: var(--navy); color: var(--white); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-quiet:hover { background: var(--alt); border-color: var(--alt); color: var(--navy); }
.btn-danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: var(--error); border-color: var(--error); color: var(--white); }
.btn .arrow { transition: transform var(--t); }
.btn:hover .arrow, .arrow-link:hover .arrow { transform: translateX(5px); }
.arrow-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.arrow { display: inline-block; width: 16px; height: 16px; flex: none; }

/* ---- Forms: underline-only fields ---- */
.field { margin: 0 0 22px; }
.field label, .label { display: block; font-weight: 600; color: var(--navy); font-size: 15px; margin-bottom: 4px; }
.field .hint { display: block; font-size: 14px; color: var(--muted); margin-top: 6px; }
.input, .textarea {
  width: 100%; min-height: 47px; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--navy);
  border-radius: 0; background: transparent; color: var(--navy); font: 400 17px/1.4 var(--sans);
  transition: border-color var(--t);
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-bottom: 2px solid var(--teal); padding-bottom: 9px; }
.input[readonly] { color: var(--ink); }
.input-row { display: flex; gap: 10px; align-items: flex-end; }
.input-row .input { flex: 1; min-width: 0; }
.prefix { display: flex; align-items: flex-end; }
.prefix span { padding: 10px 0; color: var(--muted); font-size: 15px; white-space: nowrap; border-bottom: 1px solid var(--navy); }
.prefix .input { flex: 1; min-width: 0; }
.file-input { display: block; width: 100%; padding: 16px; border: 1px dashed var(--muted); background: var(--white); font: inherit; font-size: 15px; cursor: pointer; }
.file-input:hover { border-color: var(--teal); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }

/* ---- Notices ---- */
.notice { padding: 14px 18px; margin: 0 0 24px; border-left: 4px solid var(--teal); background: var(--success-bg); color: var(--navy); }
.notice-error { border-color: var(--error); background: var(--error-bg); }
.notice strong { font-weight: 700; }

/* ---- Cards / panels ---- */
.panel { background: var(--white); border: 1px solid var(--border); padding: 30px; margin: 0 0 30px; }
@media (max-width: 640px) { .panel { padding: 20px 16px; } }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }

/* ---- Login ---- */
.auth { max-width: 460px; margin: 70px auto 0; }
.auth .panel { padding: 40px; }
@media (max-width: 640px) { .auth { margin-top: 30px; } .auth .panel { padding: 26px 16px; } }
.auth h1 { font-family: var(--serif); font-weight: 400; }

/* ---- Client prototype list ---- */
.section { padding: 50px 0 0; }
.proto-list { display: grid; gap: 24px; }
.proto { background: var(--white); border: 1px solid var(--border); border-top: 4px solid var(--teal); padding: 30px; }
.proto:nth-child(3n+2) { border-top-color: var(--yellow); }
.proto:nth-child(3n+3) { border-top-color: var(--orange); }
@media (max-width: 640px) { .proto { padding: 22px 16px; } }
.proto-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.proto-head h2 { margin: 0 0 4px; }
.meta { font-size: 14px; color: var(--muted); }
.meta strong { color: var(--navy); font-weight: 600; }
.notes { margin: 16px 0 0; white-space: pre-line; max-width: 70ch; }
.versions { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 14px; }
.versions summary { cursor: pointer; font-weight: 600; color: var(--navy); font-size: 15px; }
.versions summary:hover { color: var(--teal); }
.version-list { list-style: none; margin: 12px 0 0; padding: 0; }
.version-list li { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--alt); font-size: 15px; }
.version-list li:last-child { border-bottom: 0; }
.version-list .v { font-weight: 700; color: var(--navy); }
.version-list .vnotes { white-space: pre-line; }
@media (max-width: 560px) { .version-list li { grid-template-columns: 44px 1fr; } .version-list li > :last-child { grid-column: 2; } }
.empty { padding: 40px; text-align: center; background: var(--white); border: 1px dashed var(--border); color: var(--muted); }

/* ---- Admin ---- */
.admin-main { padding-top: 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { margin: 0; }
.crumb { font-size: 14px; margin-bottom: 6px; display: inline-block; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 30px; align-items: start; }
@media (max-width: 960px) { .layout-2 { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0 12px 10px 0; border-bottom: 1px solid var(--navy); white-space: nowrap; }
.table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr.is-hidden td { color: var(--muted); }
.table .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.table .actions form { margin: 0; }
.tag { display: inline-block; padding: 1px 10px; border-radius: 38px; font-size: 12px; font-weight: 600; background: var(--alt); color: var(--navy); vertical-align: middle; }
.tag-live { background: var(--success-bg); color: var(--teal-dark); }
.tag-warn { background: #FDF1D6; color: #7A5400; }
.admin-proto { border-top: 4px solid var(--teal); }
.admin-proto.is-archived { border-top-color: var(--border); opacity: .8; }
.admin-proto .proto-head { margin-bottom: 18px; }
.upload-box { margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--border); }
.upload-box summary { cursor: pointer; font-weight: 600; color: var(--teal); }
.upload-box[open] summary { margin-bottom: 16px; }
.notes-edit summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.notes-edit form { margin-top: 8px; }
.copy-row { display: flex; gap: 10px; align-items: flex-end; }
.copy-row .input { flex: 1; min-width: 0; font-size: 15px; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 18px; letter-spacing: 1px; color: var(--navy); background: #FDF1D6; padding: 10px 14px; display: inline-block; margin: 6px 0 4px; user-select: all; }
.stack > * + * { margin-top: 12px; }
.inline-form { display: inline; margin: 0; }
