/* ==========================================================================
   Azmin Yusmizan portfolio
   Apple-style design language: system type (SF on Apple devices, Inter
   elsewhere), generous whitespace, centred headlines, alternating white /
   light grey / black sections, rounded tiles and blue pill buttons.
   ========================================================================== */

:root {
  --white: #ffffff;
  --grey-bg: #f5f5f7;
  --black: #000000;
  --tile-dark: #1c1c1e;
  --tile-dark-2: #2c2c2e;

  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #424245;
  --text-dark: #f5f5f7;
  --text-dark-2: #a1a1a6;
  --text-dark-3: #86868b;

  --hairline: #d2d2d7;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --link: #0066cc;
  --link-dark: #2997ff;

  --trace-1: #f2c230;
  --trace-2: #5cc8d6;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;

  --nav-h: 48px;
  --gutter: 22px;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);

  color-scheme: light;
}

/* ---------- Base ---------- */

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern";
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 600;
  text-wrap: balance;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

sup {
  line-height: 0;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
}

.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-wide {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Scroll reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 22px;
  border-radius: 980px;
  border: 1px solid transparent;
  font: 400 17px/1.17 var(--font);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

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

.btn-secondary {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}

.btn-secondary:hover {
  background: var(--blue);
  color: #fff;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 17px;
  color: var(--link);
}

.link-arrow::after {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
  transform: rotate(45deg);
  margin-left: 2px;
}

.section-dark .link-arrow,
.section-dark a {
  color: var(--link-dark);
}

/* ---------- Global navigation ---------- */

.gnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  transition: box-shadow 0.3s ease;
}

.gnav.is-scrolled {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.gnav-inner {
  max-width: 1024px;
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.gnav-brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  white-space: nowrap;
}

.gnav-brand:hover {
  text-decoration: none;
  color: #000;
}

.gnav-nav {
  flex: 1;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.nav-links a {
  display: block;
  padding: 6px 10px;
  font-size: 12px;
  letter-spacing: -0.01em;
  color: rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #000;
  text-decoration: none;
}

.nav-links a[aria-current="true"] {
  color: #000;
  font-weight: 600;
}

.gnav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gnav-back {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.8);
  padding: 6px 8px;
}

.gnav-back:hover {
  color: #000;
}

.lang {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(0, 0, 0, 0.8);
  font: 500 12px var(--font);
  cursor: pointer;
}

.lang-btn:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.05);
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(0, 0, 0, 0.14);
}

.lang-menu button {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 400 14px var(--font);
  cursor: pointer;
}

.lang-menu button:hover {
  background: var(--grey-bg);
}

.lang-menu button[aria-current="true"] {
  font-weight: 600;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  margin-right: -8px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle-icon {
  position: relative;
  display: block;
  width: 17px;
  height: 10px;
  margin: auto;
}

.nav-toggle-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}

.nav-toggle-icon span:first-child {
  top: 1px;
}

.nav-toggle-icon span:last-child {
  top: 8px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:first-child {
  top: 4.5px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:last-child {
  top: 4.5px;
  transform: rotate(-45deg);
}

/* ---------- Typography helpers ---------- */

.headline-xl {
  font-size: 80px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.headline {
  font-size: 56px;
  line-height: 1.07143;
  letter-spacing: -0.025em;
}

.intro {
  font-size: 21px;
  line-height: 1.381;
  letter-spacing: 0;
  color: var(--text-2);
}

.eyebrow {
  font-size: 21px;
  line-height: 1.19;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-dark-3);
}

.gradient-text {
  background: linear-gradient(110deg, #ffd36b 0%, #f2c230 30%, #6fd3e0 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Sections ---------- */

.section {
  padding-block: 120px;
  background: var(--white);
}

.section-grey {
  background: var(--grey-bg);
}

.section-dark {
  background: var(--black);
  color: var(--text-dark);
}

.section-head {
  text-align: center;
  margin-bottom: 64px;
}

.section-head .intro {
  max-width: 680px;
  margin: 18px auto 0;
}

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 112px;
  background: var(--white);
  text-align: center;
}

.hero-head {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-photo {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--grey-bg);
  margin-bottom: 24px;
}

.hero-name {
  font-size: 96px;
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.hero-lead {
  max-width: 760px;
  margin-top: 20px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--text);
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 36px;
}

.js .hero .reveal:nth-child(2) { transition-delay: 0.08s; }
.js .hero .reveal:nth-child(3) { transition-delay: 0.16s; }
.js .hero .reveal:nth-child(4) { transition-delay: 0.24s; }

/* Oscilloscope "product shot" */

.scope {
  margin-top: 80px;
}

.scope-screen {
  position: relative;
  background: #000;
  border-radius: 28px;
  padding: 48px 0 44px;
  overflow: hidden;
}

.scope-svg {
  width: 100%;
  height: clamp(200px, 30vw, 360px);
}

.graticule path {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  fill: none;
}

.graticule-axis path {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  vector-effect: non-scaling-stroke;
  fill: none;
}

.trace {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.trace-1 {
  stroke: var(--trace-1);
  filter: drop-shadow(0 0 4px rgba(242, 194, 48, 0.6));
}

.trace-2 {
  stroke: var(--trace-2);
  filter: drop-shadow(0 0 4px rgba(92, 200, 214, 0.55));
}

@media (prefers-reduced-motion: no-preference) {
  .sweep-rect {
    transform-box: view-box;
    transform-origin: 0 0;
    transform: scaleX(0);
    animation: scope-sweep 2.6s cubic-bezier(0.5, 0, 0.25, 1) 0.6s forwards;
  }
}

@keyframes scope-sweep {
  to {
    transform: scaleX(1);
  }
}

.scope-readout {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  gap: 20px;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0;
  color: #a1a1a6;
}

.scope-readout-top {
  top: 18px;
}

.scope-readout-bottom {
  bottom: 16px;
  padding: 0;
  gap: 0;
}

.scope-readout .ch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scope-readout .ch::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ch1::before {
  background: var(--trace-1);
}

.ch2::before {
  background: var(--trace-2);
}

.scope-params {
  margin-left: auto;
}

.scope-readout-bottom span {
  text-align: center;
}

.scope-readout-bottom span:nth-child(1),
.scope-readout-bottom span:nth-child(3) {
  flex: 4;
}

.scope-readout-bottom span:nth-child(2) {
  flex: 2;
}

.scope figcaption {
  max-width: 680px;
  margin: 20px auto 0;
  font-size: 14px;
  line-height: 1.43;
  color: var(--text-2);
}

/* At a glance */

.glance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 72px;
}

.glance div {
  padding: 4px 16px;
}

.glance div + div {
  border-left: 1px solid var(--hairline);
}

.glance dt {
  font-size: 14px;
  color: var(--text-2);
}

.glance dd {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 32px;
  margin-top: 40px;
}

/* ---------- LoRa case study (dark) ---------- */

.case-head {
  text-align: center;
}

.case-head .headline-xl {
  max-width: 900px;
  margin: 14px auto 0;
  padding-bottom: 0.06em;
}

.case-intro {
  max-width: 720px;
  margin: 40px auto 0;
}

.case-intro p {
  font-size: 21px;
  line-height: 1.381;
  letter-spacing: 0;
  color: var(--text-dark-2);
}

.case-intro p + p {
  margin-top: 1em;
}

.tiles-title {
  text-align: center;
  font-size: 32px;
  line-height: 1.125;
  letter-spacing: -0.02em;
  margin: 112px 0 40px;
}

.tile {
  background: var(--tile-dark);
  border-radius: 28px;
  padding: 40px;
}

.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.tile-wide {
  grid-column: span 2;
}

.tile-label {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dark-3);
}

.tile-value {
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.27;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-dark);
}

.tile-value strong {
  font-weight: 700;
  background: linear-gradient(110deg, #ffd36b, #6fd3e0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.diagram {
  margin-top: 20px;
  padding: 48px 40px 40px;
}

.diagram svg {
  width: 100%;
  max-width: 820px;
  height: auto;
  margin-inline: auto;
  font-family: var(--font);
}

.diagram figcaption {
  max-width: 700px;
  margin: 28px auto 0;
  text-align: center;
  font-size: 17px;
  color: var(--text-dark-2);
}

.d-link {
  stroke: #6e6e73;
  stroke-width: 1.5;
}

.d-lost {
  stroke-dasharray: 5 6;
}

.d-terrain {
  fill: var(--tile-dark-2);
  stroke: #86868b;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.d-x path {
  stroke: #ff453a;
  stroke-width: 3;
  stroke-linecap: round;
}

.d-relay {
  fill: none;
  stroke: var(--link-dark);
  stroke-width: 2.5;
}

.d-arrow {
  fill: var(--link-dark);
}

.d-relay-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  fill: var(--link-dark);
}

.d-collar circle {
  fill: var(--trace-1);
}

.d-collar text,
.d-remote text {
  font-weight: 700;
  font-size: 15px;
  fill: #000;
}

.d-remote rect {
  fill: var(--text-dark);
}

.d-label {
  font-size: 14px;
  font-weight: 600;
  fill: var(--text-dark);
}

.d-note {
  font-size: 13px;
  font-style: italic;
  fill: var(--text-dark-3);
}

.tile-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.tile-grid-2 h3 {
  font-size: 28px;
  line-height: 1.143;
  letter-spacing: -0.02em;
  color: var(--text-dark);
}

.tile-grid-2 p {
  margin-top: 14px;
  color: var(--text-dark-2);
}

.log {
  margin: 24px 0 0;
  padding: 18px 20px;
  background: #000;
  border-radius: 14px;
  color: #d2d2d7;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  letter-spacing: 0;
  overflow-x: auto;
  white-space: pre;
}

.tech-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-list li {
  padding: 5px 12px;
  border-radius: 980px;
  background: var(--tile-dark-2);
  color: #d2d2d7;
  font-size: 13px;
  letter-spacing: 0;
}

/* ---------- Experience ---------- */

.exp-list {
  max-width: 1024px;
  display: grid;
  gap: 20px;
}

.exp-card {
  background: var(--grey-bg);
  border-radius: 28px;
  padding: 48px 56px;
}

.exp-top {
  display: flex;
  align-items: center;
  gap: 20px;
}

.exp-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
}

.exp-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.exp-heading h3 {
  margin-top: 2px;
  font-size: 28px;
  line-height: 1.143;
  letter-spacing: -0.02em;
}

.exp-meta {
  margin-top: 4px;
  color: var(--text-2);
}

.exp-points {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  max-width: 760px;
}

.exp-points li {
  position: relative;
  padding-left: 22px;
}

.exp-points li + li {
  margin-top: 12px;
}

.exp-points li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-2);
}

.exp-card .link-arrow {
  margin-top: 28px;
}

/* ---------- Projects ---------- */

.filters-scroll {
  text-align: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
}

.filters-scroll::-webkit-scrollbar {
  display: none;
}

.filters {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 980px;
  background: #e8e8ed;
}

.filter-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 0;
  border-radius: 980px;
  background: transparent;
  color: var(--text);
  font: 400 14px var(--font);
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.6);
}

.filter-btn[aria-pressed="true"] {
  background: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.filter-btn .count {
  color: var(--text-2);
  font-weight: 400;
  margin-left: 2px;
  font-variant-numeric: tabular-nums;
}

.project-grid {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.project {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.project:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.project-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--grey-bg);
}

.media-lora {
  display: grid;
  place-items: center;
  background: #000;
  padding: 40px;
}

.media-lora svg {
  width: 100%;
  max-width: 320px;
  height: auto;
}

.media-lora path {
  fill: none;
  stroke: var(--trace-1);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(242, 194, 48, 0.55));
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px 28px 30px;
}

.project-org {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.project h3 {
  margin-top: 4px;
  font-size: 21px;
  line-height: 1.19;
  letter-spacing: -0.015em;
}

.project-desc {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.47;
  color: var(--text-3);
}

.tags {
  list-style: none;
  margin: auto 0 0;
  padding: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags li {
  padding: 4px 10px;
  border-radius: 980px;
  background: var(--grey-bg);
  color: var(--text-3);
  font-size: 12px;
  letter-spacing: 0;
}

.project .link-arrow {
  margin-top: 18px;
}

.project-featured {
  grid-column: span 2;
  flex-direction: row;
}

.project-featured .project-media {
  width: 50%;
  aspect-ratio: auto;
  flex-shrink: 0;
}

.project-featured .project-body {
  padding: 40px;
  justify-content: center;
}

.project-featured h3 {
  font-size: 28px;
  line-height: 1.143;
}

.project-featured .project-desc {
  font-size: 17px;
}

.project-featured .tags {
  margin-top: 0;
}

/* ---------- Skills ---------- */

.skills {
  max-width: 1024px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.skill {
  background: var(--grey-bg);
  border-radius: 18px;
  padding: 36px 32px;
}

.skill h3 {
  font-size: 21px;
  line-height: 1.19;
  letter-spacing: -0.015em;
}

.skill p {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-3);
}

/* ---------- Education ---------- */

.edu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
}

.edu-list li {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 8px 32px;
  padding: 32px 40px;
}

.edu-list li + li {
  border-top: 1px solid #e8e8ed;
}

.edu-date {
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.edu-list h3 {
  font-size: 21px;
  line-height: 1.19;
  letter-spacing: -0.015em;
}

.edu-list h3 + p {
  margin-top: 6px;
  color: var(--text-3);
}

/* ---------- About ---------- */

.about-text {
  max-width: 800px;
  text-align: center;
}

.about-text p {
  font-size: 21px;
  line-height: 1.381;
  letter-spacing: 0;
  color: var(--text-2);
}

.about-text p + p {
  margin-top: 20px;
}

.about-text .about-lead {
  font-size: 28px;
  line-height: 1.286;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 32px;
}

.hobbies {
  list-style: none;
  margin-top: 72px;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.hobbies img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  background: var(--grey-bg);
}

.hobbies span {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-2);
}

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

.contact-grid {
  max-width: 1024px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 20px;
  align-items: start;
}

.contact-card {
  background: #fff;
  border-radius: 18px;
  padding: 12px 32px;
}

.contact-card div {
  padding: 20px 0;
}

.contact-card div + div {
  border-top: 1px solid #e8e8ed;
}

.contact-card dt {
  font-size: 14px;
  color: var(--text-2);
}

.contact-card dd {
  margin-top: 2px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.contact-form {
  display: grid;
  gap: 20px;
  background: #fff;
  border-radius: 18px;
  padding: 40px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: 400 17px/1.3 var(--font);
  letter-spacing: -0.01em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.16);
}

.field textarea {
  resize: vertical;
  min-height: 150px;
}

.field-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.field-check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--blue);
}

.field-check label {
  font-size: 14px;
  line-height: 1.43;
  color: var(--text-2);
}

.contact-form .btn {
  justify-self: start;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  font-size: 14px;
  font-weight: 500;
  min-height: 1.4em;
}

.form-status [data-state="ok"] {
  color: #1d7f3a;
}

.form-status [data-state="error"] {
  color: #d70015;
}

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

.footer {
  background: var(--grey-bg);
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: 0;
  color: var(--text-2);
}

.footer-inner {
  width: calc(100% - 2 * var(--gutter));
  max-width: 980px;
  padding-inline: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-block: 20px 36px;
  border-top: 1px solid var(--hairline);
}

#contact + .footer,
.footer {
  margin-top: 0;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer a {
  color: var(--text-3);
}

/* ---------- Privacy page ---------- */

.legal {
  padding: 80px 0 120px;
}

.legal-wrap {
  max-width: 736px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.legal h1 {
  font-size: 56px;
  line-height: 1.07;
  letter-spacing: -0.025em;
}

.legal-updated {
  margin-top: 12px;
  color: var(--text-2);
}

.legal-summary {
  margin-top: 40px;
  padding: 28px 32px;
  border-radius: 18px;
  background: var(--grey-bg);
  font-size: 19px;
  line-height: 1.42;
}

.legal-body h2 {
  margin-top: 56px;
  font-size: 28px;
  line-height: 1.143;
  letter-spacing: -0.02em;
}

.legal-body h3 {
  margin-top: 32px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.legal-body p,
.legal-body ul {
  margin-top: 12px;
}

.legal-body ul {
  padding-left: 1.2em;
}

.legal-body li + li {
  margin-top: 6px;
}

.legal-body a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.legal-body .link-arrow {
  text-decoration: none;
}

.legal-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--grey-bg);
}

.legal-back {
  margin-top: 56px !important;
}

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

@media (max-width: 1068px) {
  .headline-xl {
    font-size: 64px;
  }

  .headline {
    font-size: 48px;
  }

  .hero-name {
    font-size: 80px;
  }

  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile-wide {
    grid-column: span 2;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hobbies {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 16px;
  }
}

@media (max-width: 833px) {
  .nav-toggle {
    display: block;
  }

  .gnav-nav {
    flex: 0;
  }

  .nav-links {
    /* The nav's backdrop-filter makes it the containing block for fixed
       children, so the panel is sized from the viewport explicitly. */
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    height: calc(100vh - var(--nav-h));
    height: calc(100dvh - var(--nav-h));
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding: 16px 48px 48px;
    background: #fff;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s;
  }

  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s;
  }

  .nav-links a {
    padding: 10px 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
  }

  .nav-links a[aria-current="true"] {
    font-weight: 600;
  }

  html.nav-open {
    overflow: hidden;
  }
}

@media (max-width: 734px) {
  body {
    font-size: 17px;
  }

  .section {
    padding-block: 80px;
  }

  .section-head {
    margin-bottom: 44px;
  }

  .headline-xl {
    font-size: 40px;
    line-height: 1.1;
  }

  .headline {
    font-size: 40px;
    line-height: 1.1;
  }

  .intro,
  .case-intro p,
  .about-text p {
    font-size: 19px;
    line-height: 1.42;
  }

  .eyebrow {
    font-size: 17px;
  }

  .hero {
    padding: 48px 0 80px;
  }

  .hero-photo {
    width: 96px;
    height: 96px;
  }

  .hero-name {
    font-size: 48px;
    line-height: 1.05;
  }

  .hero-lead {
    font-size: 21px;
    line-height: 1.29;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .scope {
    margin-top: 56px;
  }

  .scope-screen {
    border-radius: 20px;
    padding: 40px 0 36px;
  }

  .scope-readout {
    font-size: 10px;
    padding: 0 14px;
    gap: 12px;
  }

  .scope-params {
    display: none;
  }

  .glance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 24px;
    margin-top: 48px;
  }

  .glance div:nth-child(3) {
    border-left: 0;
  }

  .tiles-title {
    font-size: 24px;
    margin: 72px 0 28px;
  }

  .tile {
    border-radius: 22px;
    padding: 28px;
  }

  .bento,
  .tile-grid-2 {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .tile-grid-2 {
    margin-top: 14px;
  }

  .diagram {
    margin-top: 14px;
    padding: 24px 16px 28px;
  }

  .tile-wide {
    grid-column: auto;
  }

  .diagram-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-inline: -16px;
    padding-inline: 16px;
  }

  .diagram svg {
    width: 640px;
    max-width: none;
  }

  .tile-value {
    font-size: 21px;
  }

  .tile-grid-2 h3,
  .exp-heading h3,
  .project-featured h3 {
    font-size: 24px;
  }

  .exp-card {
    border-radius: 22px;
    padding: 28px;
  }

  .exp-top {
    align-items: flex-start;
  }

  .exp-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .filters-scroll {
    text-align: left;
  }

  .skills {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Projects become a swipeable gallery, like Apple's mobile galleries */
  .project-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1);
    padding: 4px var(--gutter) 24px;
    margin-top: 28px;
  }

  .project-grid::-webkit-scrollbar {
    display: none;
  }

  .project {
    flex: 0 0 84%;
    scroll-snap-align: start;
  }

  .project:hover {
    transform: none;
  }

  .project-media {
    aspect-ratio: 16 / 10;
  }

  .project-featured {
    grid-column: auto;
    flex-direction: column;
  }

  .project-featured .project-media {
    width: 100%;
    aspect-ratio: 16 / 10;
    padding: 28px;
  }

  .project-featured .project-body {
    padding: 24px 28px 30px;
  }

  .skill {
    padding: 28px;
  }

  .edu-list li {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 24px;
  }

  .about-text .about-lead {
    font-size: 21px;
    line-height: 1.33;
  }

  .hobbies {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 56px;
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-card {
    padding: 8px 24px;
  }

  .contact-form {
    padding: 28px 24px;
  }

  .legal {
    padding: 48px 0 80px;
  }

  .legal h1 {
    font-size: 40px;
  }

  .legal-summary {
    padding: 22px 24px;
    font-size: 17px;
  }
}

/* ---------- Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .gnav,
  .scope,
  .contact-form,
  .filters-scroll,
  .skip-link {
    display: none !important;
  }

  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .project[hidden] {
    display: flex !important;
  }

  .section-dark {
    background: #fff;
    color: #000;
  }

  .tile {
    background: #f5f5f7;
  }

  .tile-value,
  .tile-grid-2 h3 {
    color: #000;
  }

  .gradient-text,
  .tile-value strong {
    color: #000;
    background: none;
  }

  .section {
    padding-block: 32px;
  }
}

html.nav-open .gnav {
  background: #fff;
}
