/* ============================================================
   STYLES

   Sections in this file:
     1. Tokens        colours, type, spacing
     2. Base          resets and defaults
     3. Layout        shell, sections, section heads
     4. Site bar
     5. Hero
     6. Buttons
     7. Work          featured panel, stage flow, record log
     8. Skills
     9. Note, background, contact, footer
    10. Chat panel
    11. Responsive
    12. Motion preferences
   ============================================================ */

/* ---------- 1. Tokens ------------------------------------- */
:root {
  color-scheme: light;

  /* colour */
  --paper:     #edf0f3;   /* cool steel page ground */
  --paper-2:   #e4e9ed;   /* tinted band between sections */
  --panel:     #ffffff;   /* raised record surface */
  --ink:       #17212c;   /* body and headings */
  --ink-soft:  #5c6b79;   /* secondary text */
  --rule:      #c6d0d8;   /* hairlines */
  --rule-soft: #dbe2e8;
  --tag:       #f2c230;   /* equipment-tag amber, used sparingly */
  --link:      #0d6b61;   /* oxidised teal */
  --link-dark: #084d46;

  /* type */
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* spacing */
  --gap: 1.5rem;
  --section-y: clamp(3.5rem, 8vw, 6.5rem);
}

/* ---------- 2. Base --------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-dark); }

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
  z-index: 60;
  font-family: var(--display);
}
.skip-link:focus { left: 0; }

.noscript {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  background: var(--ink);
  color: var(--paper);
  padding: 1rem 1.2rem;
  font-family: var(--display);
  font-size: 0.95rem;
  border-radius: 4px;
  z-index: 50;
}

/* ---------- 3. Layout ------------------------------------- */
.shell {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}
.shell--narrow { max-width: 47rem; }

.section { padding: var(--section-y) 0; }
.section--tint { background: var(--paper-2); }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.6rem;
}

.section__title {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-stretch: 108%;
  font-weight: 700;
}
.section__title--small {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.1rem;
}

.section__meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
  max-width: 34rem;
}

.prose { color: var(--ink-soft); max-width: 36rem; }

/* ---------- 4. Site bar ----------------------------------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(237, 240, 243, 0.88);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.bar__inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0.75rem clamp(1.25rem, 5vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.bar__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.bar__mark:hover { color: var(--ink); }

.bar__tag {
  width: 22px;
  height: 8px;
  background: var(--tag);
  border-radius: 1px;
  display: inline-block;
}

.bar__nav {
  display: flex;
  gap: clamp(0.9rem, 2.6vw, 1.9rem);
  font-family: var(--display);
  font-size: 0.94rem;
}
.bar__nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}
.bar__nav a:hover,
.bar__nav a.is-current {
  color: var(--ink);
  border-bottom-color: var(--tag);
}

/* ---------- 5. Hero --------------------------------------- */
.hero {
  padding: clamp(3rem, 9vw, 6rem) 0 clamp(3rem, 7vw, 5rem);
}

.hero__role {
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
}

.hero__headline {
  font-size: clamp(2.45rem, 7.4vw, 5rem);
  font-weight: 700;
  font-stretch: 112%;
  line-height: 0.98;
  letter-spacing: -0.028em;
  margin: 0 0 1.6rem;
  max-width: 16ch;
}
.hero__headline .line { display: block; }

.hero__intro {
  max-width: 44ch;
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin-bottom: 2.6rem;
}

.tracks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
  margin-bottom: 2.4rem;
}
.track { padding: 1.5rem 1.8rem 1.5rem 0; }
.track + .track {
  border-left: 1px solid var(--rule);
  padding-left: 1.8rem;
  padding-right: 0;
}
.track h2 {
  font-size: 1.12rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.track p {
  color: var(--ink-soft);
  font-size: 0.99rem;
  max-width: 34ch;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ---------- 6. Buttons ------------------------------------ */
.button {
  display: inline-block;
  font-family: var(--display);
  font-size: 0.97rem;
  font-weight: 500;
  padding: 0.66rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.button:hover { background: var(--ink); color: var(--paper); }

.button--solid {
  background: var(--ink);
  color: var(--paper);
}
.button--solid:hover { background: var(--link); border-color: var(--link); color: #fff; }

/* ---------- 7. Work --------------------------------------- */

/* featured record */
.feature {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: clamp(1.5rem, 4vw, 2.6rem);
  margin-bottom: 3.2rem;
}

.feature__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
  margin-bottom: 0.4rem;
}

.feature__name {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 700;
  font-stretch: 106%;
}
.feature__kind {
  font-family: var(--display);
  font-size: 0.97rem;
  color: var(--ink-soft);
  margin: 0.3rem 0 1.35rem;
}
.feature__summary {
  max-width: 62ch;
  margin-bottom: 1.9rem;
}

.chip {
  display: inline-block;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--tag);
  color: #2a2200;
  white-space: nowrap;
}
.chip--quiet {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  font-weight: 500;
}

/* the ticket lifecycle, drawn */
.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0 0 2.1rem;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  padding: 1.25rem 0;
}
.flow__step {
  position: relative;
  padding-right: 1rem;
  font-family: var(--display);
  font-size: 0.93rem;
  color: var(--ink-soft);
}
.flow__dot {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tag);
  margin-bottom: 0.6rem;
  position: relative;
}
.flow__step::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 9px;
  right: 0;
  height: 1px;
  background: var(--rule);
}
.flow__step:last-child::before { display: none; }
.flow__step:last-child .flow__dot { background: var(--link); }

/* detail blocks, shared by featured and expanded rows */
.blocks { display: grid; gap: 1.5rem; }
.block__label {
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.35rem;
}
.block__body { color: var(--ink-soft); max-width: 66ch; margin: 0; }

.feature__foot { margin-top: 2rem; }

/* record log */
.log { border-top: 1px solid var(--rule); }

.record { border-bottom: 1px solid var(--rule); }

.record__head {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  background: none;
  border: 0;
  padding: 1.25rem 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.record__head:hover .record__name { color: var(--link); }

.record__name {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.008em;
  transition: color 0.15s ease;
}
.record__kind {
  font-family: var(--display);
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.record__sign {
  justify-self: end;
  width: 26px;
  height: 26px;
  position: relative;
  flex: none;
}
.record__sign::before,
.record__sign::after {
  content: "";
  position: absolute;
  background: var(--ink);
  left: 50%;
  top: 50%;
  transition: transform 0.22s ease;
}
.record__sign::before { width: 13px; height: 1.5px; transform: translate(-50%, -50%); }
.record__sign::after  { width: 1.5px; height: 13px; transform: translate(-50%, -50%); }
.record__head[aria-expanded="true"] .record__sign::after { transform: translate(-50%, -50%) scaleY(0); }

.record__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}
.record__panel > div { overflow: hidden; }
.record.is-open .record__panel { grid-template-rows: 1fr; }

.record__inner { padding: 0.25rem 0 1.9rem; max-width: 62rem; }
.record__summary { margin-bottom: 1.5rem; max-width: 66ch; }
.record__links { margin-top: 1.6rem; }

.record__nolink {
  font-family: var(--display);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- 8. Skills ------------------------------------- */
.skill-group { margin-bottom: 2.8rem; }
.skill-group:last-child { margin-bottom: 0; }

.skill-group__name {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
}

.skill {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) 9rem;
  gap: 0.35rem 1.6rem;
  align-items: baseline;
  padding: 0.95rem 0;
  border-top: 1px solid var(--rule-soft);
}
.skill:first-of-type { border-top: 1px solid var(--rule); }

.skill__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
}
.skill__note { color: var(--ink-soft); font-size: 0.99rem; margin: 0; }
.skill__level {
  font-family: var(--display);
  font-size: 0.86rem;
  color: var(--ink-soft);
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}
.skill__level .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 0.45rem;
  vertical-align: 1px;
  background: var(--rule);
}
.skill__level.is-daily .dot { background: var(--tag); }
.skill__level.is-comfortable .dot { background: var(--link); }

.skill__shown {
  grid-column: 2;
  font-family: var(--display);
  font-size: 0.86rem;
  margin: 0;
}
.skill__shown a { color: var(--ink-soft); }
.skill__shown a:hover { color: var(--link); }

/* ---------- 9. Note, background, contact, footer ---------- */
.note__lead {
  font-family: var(--display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.015em;
  max-width: 24ch;
  margin: 0 0 1.8rem;
  padding-left: 1.2rem;
  border-left: 4px solid var(--tag);
}
.note__body p { color: var(--ink-soft); max-width: 68ch; margin-bottom: 1.1rem; }
.note__body p:last-child { margin-bottom: 0; }
.note__title {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 1.2rem;
}

.now-line {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 500;
  line-height: 1.38;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 44ch;
  margin: 0;
}

.section--contact { background: var(--ink); color: var(--paper); }
.section--contact .section__title { color: var(--paper); margin-bottom: 1.4rem; }
.contact__avail { color: #b9c5d0; max-width: 46ch; margin-bottom: 1.8rem; }
.contact__email {
  font-family: var(--display);
  font-size: clamp(1.5rem, 4.2vw, 2.6rem);
  font-weight: 700;
  font-stretch: 106%;
  letter-spacing: -0.02em;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 3px solid var(--tag);
  word-break: break-word;
}
.contact__email:hover { color: var(--tag); }
.contact__links { margin-top: 1.9rem; display: flex; gap: 1.4rem; font-family: var(--display); font-size: 0.97rem; }
.contact__links a { color: #b9c5d0; }
.contact__links a:hover { color: var(--tag); }

.foot {
  padding: 2.2rem 0 2.8rem;
  border-top: 1px solid var(--rule);
  font-family: var(--display);
  font-size: 0.92rem;
}
.foot p { margin: 0 0 0.3rem; }
.foot__dim { color: var(--ink-soft); }

/* ---------- 10. Chat panel -------------------------------- */
.chat-open {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.8rem 1.3rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(23, 33, 44, 0.32), 0 2px 6px rgba(23, 33, 44, 0.2);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.chat-open:hover {
  background: var(--link);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(13, 107, 97, 0.38);
}
.chat-open:active {
  transform: translateY(0);
}
.chat-open__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.chat-open__pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 2s infinite cubic-bezier(0.45, 0, 0.2, 1);
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.chat {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 46;
  width: min(25rem, calc(100vw - 2rem));
  height: min(34rem, calc(100vh - 2.5rem));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(23, 33, 44, 0.28), 0 4px 16px rgba(23, 33, 44, 0.08);
  overflow: hidden;
  animation: chat-popup 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.chat[hidden] { display: none; }

@keyframes chat-popup {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem 1.1rem;
  background: #ffffff;
  border-bottom: 1px solid var(--rule-soft);
}
.chat__bar-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.chat__avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ink) 0%, #2c3e50 100%);
  color: var(--tag);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(23, 33, 44, 0.15);
}
.chat__title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.chat__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat__status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1;
}
.chat__status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.chat__status--live {
  color: #059669;
}
.chat__status--live .chat__status-dot {
  background: #10b981;
  box-shadow: 0 0 5px #10b981;
}
.chat__status--smart {
  color: #b45309;
}
.chat__status--smart .chat__status-dot {
  background: var(--tag);
}

.chat__controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.chat__tool-btn,
.chat__close {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.chat__tool-btn:hover,
.chat__close:hover {
  background: var(--paper);
  color: var(--ink);
}

/* Chat Messages Log */
.chat__log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: linear-gradient(180deg, #fafbfc 0%, var(--panel) 100%);
  scroll-behavior: smooth;
}
.chat__log::-webkit-scrollbar {
  width: 5px;
}
.chat__log::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 999px;
}

/* Message bubbles */
.msg {
  max-width: 90%;
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  font-family: var(--display);
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.msg a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.msg code {
  background: rgba(0, 0, 0, 0.07);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.84rem;
  font-family: monospace;
}
.msg strong {
  font-weight: 600;
}
.msg__list {
  margin: 0.4rem 0;
  padding-left: 1.25rem;
}
.msg__list li {
  margin-bottom: 0.25rem;
}

.msg--bot {
  background: #f1f5f9;
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  border: 1px solid rgba(198, 208, 216, 0.4);
}
.msg--you {
  background: var(--ink);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
  box-shadow: 0 2px 6px rgba(23, 33, 44, 0.18);
}
.msg--status {
  align-self: center;
  max-width: 95%;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #fde68a;
  text-align: center;
}
.msg--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  align-self: flex-start;
}

.chat__retry-btn {
  display: inline-block;
  margin-top: 0.6rem;
  background: #ffffff;
  border: 1px solid #fca5a5;
  color: #991b1b;
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat__retry-btn:hover {
  background: #fee2e2;
}

/* Typing indicator */
.msg--typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.7rem 1rem;
  background: #f1f5f9;
}
.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--ink-soft);
  border-radius: 50%;
  animation: typing-bounce 1.3s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Suggested chips */
.chat__chips {
  display: flex;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  background: #ffffff;
  border-top: 1px solid var(--rule-soft);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.chat__chips::-webkit-scrollbar {
  display: none;
}
.chat__chip {
  flex-shrink: 0;
  font-family: var(--display);
  font-size: 0.77rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat__chip:hover {
  background: var(--paper-2);
  border-color: var(--ink-soft);
  color: var(--ink);
}

/* Input form */
.chat__form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  background: #ffffff;
  border-top: 1px solid var(--rule-soft);
}
.chat__input {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-size: 0.92rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.chat__input:focus {
  border-color: var(--link);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(13, 107, 97, 0.12);
}
.chat__send {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.chat__send:hover:not(:disabled) {
  background: var(--link);
  transform: scale(1.04);
}
.chat__send:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}
.chat__send.is-busy {
  opacity: 0.7;
}

/* ---------- 11. Responsive -------------------------------- */
@media (max-width: 860px) {
  .skill { grid-template-columns: 1fr auto; }
  .skill__note { grid-column: 1 / -1; }
  .skill__shown { grid-column: 1 / -1; }
  .skill__level { grid-row: 1; grid-column: 2; }
}

@media (max-width: 680px) {
  body { font-size: 1.02rem; }

  .tracks { grid-template-columns: 1fr; }
  .track { padding: 1.3rem 0; border-top: 1px solid var(--rule-soft); }
  .track:first-child { border-top: 0; }
  .track + .track { border-left: 0; padding-left: 0; }

  .flow { grid-template-columns: 1fr 1fr; gap: 1rem 0; }
  .flow__step:nth-child(2)::before { display: none; }

  .record__head { grid-template-columns: minmax(0, 1fr) auto; }
  .record__kind { grid-column: 1; grid-row: 2; }
  .record__sign { grid-row: 1 / span 2; }

  .bar__nav { gap: 0.85rem; font-size: 0.88rem; }
  .bar__mark span:not(.bar__tag) { display: none; }

  .chat { width: calc(100vw - 1.5rem); right: 0.75rem; bottom: 0.75rem; height: min(28rem, calc(100vh - 1.5rem)); }
}

/* ---------- 12. Motion ------------------------------------ */
/* One load sequence, and only on the hero. Nothing else animates
   unless a person asks it to. */
@media (prefers-reduced-motion: no-preference) {
  .hero__role,
  .hero__headline .line,
  .hero__intro,
  .tracks,
  .hero__actions {
    animation: rise 0.62s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }
  .hero__role                  { animation-delay: 0.02s; }
  .hero__headline .line:nth-child(1) { animation-delay: 0.10s; }
  .hero__headline .line:nth-child(2) { animation-delay: 0.18s; }
  .hero__headline .line:nth-child(3) { animation-delay: 0.26s; }
  .hero__headline .line:nth-child(4) { animation-delay: 0.34s; }
  .hero__intro   { animation-delay: 0.42s; }
  .tracks        { animation-delay: 0.50s; }
  .hero__actions { animation-delay: 0.58s; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
