/* Team iScale — Editorial Engineering Portfolio Stylesheet */
:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-alt: #f4f6f8;
  --ink: #0f172a;
  --body: #334155;
  --muted: #5b6778;
  --border: #dde3ea;
  --navy: #1b4965;
  --navy-dark: #13364b;
  --navy-tint: #eef5f9;
  --teal: #0f766e;
  --teal-tint: #f0fdfa;
  --font-serif: Georgia, "Liberation Serif", "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --radius: 4px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 0.96rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

p {
  margin: 0 0 0.75rem;
}

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--navy-dark);
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-alt);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 250, 248, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 10px;
  height: 10px;
  background: var(--navy);
  border-radius: 2px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-inst {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 0.55rem;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.88rem;
}

.site-nav a {
  color: var(--body);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.site-nav a:hover, .site-nav a[aria-current="true"] {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1.15rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}

.btn:active { transform: translateY(1px); }

.btn-sm { padding: 0.38rem 0.8rem; font-size: 0.82rem; }

.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover {
  background: var(--navy-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--navy);
  color: var(--navy);
}

/* Hero */
.hero {
  padding: 3.25rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 0.65rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}

.hero-lead {
  max-width: 68ch;
  font-size: 1.04rem;
  color: var(--body);
  margin-bottom: 1.4rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.25rem;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 1.25rem 0 0;
  border-top: 1.5px solid var(--ink);
}

.metric dt {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.metric dd {
  margin: 0;
}

.metric-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.metric-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Sections */
.section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.section-alt {
  background: var(--surface-alt);
}

.section-head {
  margin-bottom: 1.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--navy);
}

.section-head h2 {
  font-size: 1.45rem;
  color: var(--navy);
}

.section-sub {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

/* Synergy table */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.synergy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
}

.synergy-table th, .synergy-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.synergy-table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy);
  background: var(--surface-alt);
}

.synergy-table tbody tr:last-child th,
.synergy-table tbody tr:last-child td {
  border-bottom: none;
}

.synergy-table tbody th {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.callout {
  margin-top: 1.25rem;
  padding: 0.95rem 1.15rem;
  background: var(--navy-tint);
  border-left: 3px solid var(--navy);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.92rem;
}
.callout p { margin: 0; }

/* Live Systems Grid */
.systems-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}

.card:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card h3 {
  font-size: 1.05rem;
}

.card p {
  font-size: 0.9rem;
  margin: 0;
}

.card-note {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  background: var(--surface-alt);
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid var(--border);
}

.badge-live {
  background: var(--teal-tint);
  color: var(--teal);
  border-color: #99f6e4;
}

.card-link {
  margin-top: auto;
  padding-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: auto;
}

/* Team Tabs & Sheets */
.tab-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tab-bar button {
  background: var(--surface);
  color: var(--body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.38rem 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}

.tab-bar button:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.tab-bar button[aria-selected="true"] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.members-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.member-sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2.5px solid var(--navy);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
}

.member-sheet[hidden] {
  display: none;
}

.member-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1.5rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.member-header > div:first-child {
  flex: 1 1 380px;
}

.member-role {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy);
  margin: 0 0 0.2rem;
}

.member-header h3 {
  font-size: 1.3rem;
}

.member-edu {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.member-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.member-cols {
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  gap: 1.5rem;
}

.member-sheet h4 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
  margin: 0 0 0.55rem;
}

.member-side h4:not(:first-child) {
  margin-top: 1.05rem;
}

.cv-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.cv-list li {
  margin-bottom: 0.5rem;
}

.cv-list li:last-child {
  margin-bottom: 0;
}

.stack-line {
  font-size: 0.87rem;
  color: var(--body);
  margin: 0;
}

/* Payuphat Figures */
.figure-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.tech-figure {
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.tech-figure img {
  max-width: 100%;
  height: 230px;
  object-fit: contain;
  display: block;
}

.tech-figure figcaption {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: left;
  width: 100%;
  line-height: 1.45;
}

/* Footer */
.site-footer {
  padding: 2.5rem 0 3rem;
  background: var(--surface);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 2rem;
  align-items: start;
}

.footer-primary h2 {
  font-size: 1.2rem;
  margin-bottom: 0.45rem;
}

.footer-primary p {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 52ch;
  margin-bottom: 1rem;
}

.footer-contacts h3 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
  margin-bottom: 0.65rem;
}

.footer-contacts ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
}

.footer-contacts li {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.footer-contacts li:last-child {
  border-bottom: none;
}

.footer-contacts span {
  font-weight: 600;
  color: var(--ink);
}

/* Responsive */
@media (max-width: 820px) {
  .metrics-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .systems-grid, .member-cols, .figure-strip, .footer-inner { grid-template-columns: 1fr; }
  .member-links { align-items: flex-start; }
  .site-nav { display: none; }
}

@media (max-width: 640px) {
  .synergy-table thead { display: none; }
  .synergy-table, .synergy-table tbody, .synergy-table tr, .synergy-table th, .synergy-table td {
    display: block;
    width: 100%;
  }
  .synergy-table tr {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border);
  }
  .synergy-table tr:last-child { border-bottom: none; }
  .synergy-table th, .synergy-table td {
    padding: 0.15rem 0;
    border-bottom: none;
    white-space: normal;
  }
  .synergy-table td:first-of-type {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--navy);
    margin-bottom: 0.25rem;
  }
}

@media (max-width: 480px) {
  .hero { padding: 2.25rem 0 1.75rem; }
  .section { padding: 2.25rem 0; }
  .member-sheet { padding: 1.1rem; }
  .metrics-strip { grid-template-columns: 1fr; }
  .synergy-table tbody th { white-space: normal; }
  .tech-figure img { height: 190px; }
}

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