/* bayunugraha.com v2: a badminton court, seen from above */

:root {
  --font: 'Archivo', system-ui, 'Segoe UI', Roboto, sans-serif;

  --surround: #0F3F2E;
  --court: #14533C;
  --court-2: #196246;
  --line: #F3F1E7;
  --ink: #F3F1E7;
  --ink-soft: #C9D8CF;
  --yellow: #F2D35B;
  --board: #0B2A20;

  --gap-s: 1.5rem;
  --gap-m: 3rem;
  --gap-l: clamp(4rem, 8vw, 8rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--surround);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.1rem;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

a { color: var(--ink); text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: .2em; }
a:hover { color: var(--yellow); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--yellow); color: var(--board); padding: .6rem 1rem; z-index: 10; text-decoration: none; }
.skip:focus { top: 1rem; }

.wrap { max-width: 74rem; margin: 0 auto; padding: 0 1rem; }

h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1; letter-spacing: -.01em; }
h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-stretch: 112%; text-transform: uppercase; margin-bottom: var(--gap-s); }
.kicker { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--yellow); }

section { padding: var(--gap-l) 0 0; scroll-margin-top: 1rem; }

/* ---------- Top bar ---------- */

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; }
.topbar .brand { font-weight: 800; font-stretch: 112%; text-transform: uppercase; letter-spacing: .04em; }
.langs { display: flex; gap: .25rem; }
.langs a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 .6rem;
  font-weight: 700; font-size: .9rem; letter-spacing: .06em; text-decoration: none; color: var(--ink-soft);
  border: 2px solid transparent;
}
.langs a:hover { color: var(--yellow); }
.langs a[aria-current="page"] { color: var(--board); background: var(--yellow); border-color: var(--yellow); }

/* ---------- The court (hero) ---------- */

.court {
  position: relative;
  background: var(--court);
  border: 4px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  min-height: clamp(30rem, 46vw, 36rem);
}
/* real court markings (13.40 x 6.10 m), stretched to the box, constant stroke */
.lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.lines path { fill: none; stroke: rgba(243, 241, 231, .5); stroke-width: 2; vector-effect: non-scaling-stroke; }
.lines-v { display: none; }
.net {
  position: absolute; top: -4px; bottom: -4px; left: 50%; width: 10px; transform: translateX(-50%);
  background: repeating-linear-gradient(0deg, var(--line) 0 3px, transparent 3px 9px), repeating-linear-gradient(90deg, rgba(243,241,231,.5) 0 1px, transparent 1px 5px);
  border-left: 2px solid var(--line); border-right: 2px solid var(--line);
  z-index: 1;
}
.half { position: relative; z-index: 2; padding: clamp(2rem, 5vw, 4rem); display: flex; align-items: center; }
.half.left { padding-right: clamp(2.5rem, 6vw, 5rem); }
.half.right { justify-content: center; padding-left: clamp(2.5rem, 6vw, 5rem); }

/* the copy sits on its own patch of court so no line ever crosses the text */
.copy { background: var(--court); padding: 1.5rem 1.75rem; margin: -1.5rem -1.75rem; }

.hero h1 { font-size: clamp(2.8rem, 5.6vw, 5rem); font-stretch: 100%; overflow-wrap: anywhere; text-transform: uppercase; line-height: .9; margin: 1rem 0 1.25rem; }
.hero .role { font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 700; line-height: 1.3; text-wrap: balance; max-width: 22ch; margin: 0 0 .6rem; }
.hero .pitch { color: var(--ink-soft); margin: 0 0 var(--gap-s); max-width: 36ch; }
.photo { margin: 0; width: min(100%, 22rem); border: 4px solid var(--line); background: var(--line); }
.photo img { display: block; width: 100%; height: auto; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: .6rem 1.7rem;
  font-family: var(--font); font-weight: 800; font-size: 1rem; text-transform: uppercase; letter-spacing: .08em;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  color: var(--board); background: var(--yellow); border: 2px solid var(--yellow); border-radius: 999px;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.button:hover { background: transparent; color: var(--yellow); }

/* shuttlecock rally over the net */
/* lands on the floor of the right half, between the net and the photo */
.shuttle { position: absolute; z-index: 3; width: 40px; height: 40px; left: 53.5%; top: 80%; transform: rotate(115deg); color: var(--line); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .shuttle { animation: rally 700ms var(--ease) 300ms both; }
}
@keyframes rally {
  0%   { left: 12%; top: 78%; transform: rotate(-35deg); }
  55%  { left: 46%; top: 6%;  transform: rotate(40deg); }
  100% { left: 53.5%; top: 80%; transform: rotate(115deg); }
}

/* ---------- Scoreboard ---------- */

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--board); border: 2px solid var(--line); margin-top: 1.25rem; }
.board div { padding: 1.1rem 1.25rem; border-right: 2px solid rgba(243,241,231,.25); }
.board div:last-child { border-right: 0; }
.board b { display: block; font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 800; font-stretch: 75%; line-height: 1; color: var(--yellow); }
.board span { display: block; margin-top: .4rem; font-size: .9rem; line-height: 1.35; color: var(--ink-soft); }

/* ---------- Profile: player card ---------- */

.profile { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--gap-m); align-items: start; }
.profile p { margin: 0 0 var(--gap-s); max-width: 64ch; }
.player { margin: 0; border: 2px solid var(--line); background: var(--court); }
.player div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: .8rem 1.1rem; border-bottom: 2px solid rgba(243,241,231,.2); }
.player div:last-child { border-bottom: 0; }
.player dt { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--yellow); padding-top: .25rem; }
.player dd { margin: 0; font-weight: 600; }

/* ---------- Rally: what he checks ---------- */

.rally { list-style: none; margin: 0; padding: 0; position: relative; }
.rally::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 2px dashed rgba(243,241,231,.5); }
.rally li { position: relative; width: calc(50% - 2.5rem); padding: 1.1rem 1.25rem; margin-bottom: 1rem; background: var(--court); border-left: 4px solid var(--yellow); }
.rally li:nth-child(even) { margin-left: auto; border-left: 0; border-right: 4px solid var(--yellow); text-align: right; }
.rally .shot { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--yellow); }
.rally strong { display: block; font-size: 1.3rem; line-height: 1.2; margin: .3rem 0; }
.rally span.d { color: var(--ink-soft); }

/* ---------- Match history (career) ---------- */

.history { width: 100%; border-collapse: collapse; border: 2px solid var(--line); }
.history th, .history td { text-align: left; padding: 1rem 1.2rem; border-bottom: 2px solid rgba(243,241,231,.2); }
.history thead th { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--board); background: var(--line); }
.history tbody tr { background: var(--court); }
.history tbody tr:first-child td:first-child { color: var(--yellow); }
.history td.when { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; width: 9rem; }
.history td.role { font-weight: 700; }
.history td.org { color: var(--ink-soft); }
.edu { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; margin-top: 1rem; padding: 1.2rem; border: 2px dashed rgba(243,241,231,.5); }
.edu strong { display: block; }
.edu span { color: var(--ink-soft); }
.edu .years { color: var(--yellow); font-weight: 800; }

/* ---------- Off the clock ---------- */

.off { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: stretch; }
.off > p { margin: 0; font-size: 1.35rem; line-height: 1.45; font-weight: 600; align-self: center; }
.off .card { background: var(--line); color: var(--board); padding: 1.3rem; }
.off .card b { display: block; font-size: 1.4rem; font-stretch: 112%; text-transform: uppercase; margin-bottom: .3rem; }
.off .card span { color: #2B4A3E; }

/* ---------- Contact ---------- */

.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--gap-m); align-items: start; }
.contact p { margin: 0 0 1rem; max-width: 46ch; }
.form { background: var(--court); border: 4px solid var(--line); padding: clamp(1.25rem, 3vw, 2rem); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--yellow); margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: .6rem .8rem;
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surround);
  border: 2px solid rgba(243,241,231,.6); border-radius: 0;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.5rem; }
.field select option { background: var(--surround); color: var(--ink); }
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--yellow); outline-offset: 0; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; line-height: 1.45; margin: 1.2rem 0; color: var(--ink-soft); }
.consent input { width: 20px; height: 20px; margin-top: .1rem; flex-shrink: 0; accent-color: var(--yellow); }
.sent { display: none; margin-top: 1rem; font-weight: 700; color: var(--yellow); }
.sent.is-visible { display: block; }

/* ---------- Footer ---------- */

.site-footer { margin-top: var(--gap-l); border-top: 4px solid var(--line); padding: var(--gap-m) 0; background: var(--board); }
.site-footer .brand { font-weight: 800; font-stretch: 112%; text-transform: uppercase; font-size: 1.5rem; margin: 0 0 1rem; }
.site-footer p { margin: 0 0 .6rem; font-size: .92rem; color: var(--ink-soft); max-width: 72ch; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer .langs { margin-bottom: .75rem; }

/* ---------- Plain pages ---------- */

.plain { padding-top: var(--gap-m); }
.plain .back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .9rem; text-decoration: none; }
.plain .sheet { max-width: 48rem; background: var(--court); border: 4px solid var(--line); padding: clamp(1.5rem, 4vw, 3rem); margin-top: 1rem; }
.plain h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); font-stretch: 112%; text-transform: uppercase; margin: 0 0 .5rem; }
.plain .updated { color: var(--ink-soft); margin: 0 0 var(--gap-s); }
.plain h2 { font-size: 1.3rem; font-stretch: 100%; text-transform: none; margin: var(--gap-s) 0 .4rem; }
.plain p { margin: 0 0 1rem; }
.notfound .big { font-size: clamp(5rem, 18vw, 9rem); font-weight: 800; font-stretch: 75%; line-height: 1; color: var(--yellow); margin: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .profile, .contact { grid-template-columns: minmax(0, 1fr); }
  .off { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .off > p { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  /* the court turns: halves stack, net becomes horizontal */
  .court { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 1fr; min-height: 0; }
  .net { top: 50%; bottom: auto; left: -4px; right: -4px; width: auto; height: 10px; transform: translateY(-50%);
         background: repeating-linear-gradient(90deg, var(--line) 0 3px, transparent 3px 9px); border: 0; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
  .lines-h { display: none; }
  .lines-v { display: block; }
  .half.left { padding: 2.5rem 1.75rem; }
  .half.right { padding: 2.5rem 1.75rem; }
  .copy { padding: 1rem 1.1rem; margin: -1rem -1.1rem; }
  .shuttle { display: none; }
  .rally::before { left: .9rem; }
  .rally li, .rally li:nth-child(even) { width: auto; margin-left: 2.2rem; text-align: left; border-right: 0; border-left: 4px solid var(--yellow); }
  .history td.when { width: auto; }
}
@media (max-width: 560px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .board div { border-right: 0; border-bottom: 2px solid rgba(243,241,231,.25); }
  .board div:last-child { border-bottom: 0; }
  .off { grid-template-columns: minmax(0, 1fr); }
  .player div { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .history thead { display: none; }
  .history tr { display: grid; padding: .9rem 1rem; border-bottom: 2px solid rgba(243,241,231,.2); }
  .history td { display: block; padding: 0; border: 0; }
  .button { width: 100%; }
}

/* main nav */
.topbar { flex-wrap: wrap; }
.mainnav a[aria-current="page"] { color: var(--board); background: var(--yellow); border-color: var(--yellow); }

