:root {
  --bg: #EEF2F8;
  --surface: #FFFFFF;
  --ink: #1A2142;
  --muted: #59627F;
  --accent: #3048E0;
  --line: #CDD5E6;
  --sky: #BFD3F2;

  --title: "Google Sans Flex", "Segoe UI", system-ui, sans-serif;
  --display: "Orbitron", "Eurostile", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
  --step-3: clamp(2.6rem, 1.2rem + 5vw, 5rem);

  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-theme="dark"] {
  --bg: #151A35;
  --surface: #1F2548;
  --ink: #E7EAF6;
  --muted: #9AA2C4;
  --accent: #FFC65C;
  --line: #2F3766;
  --sky: #262E5C;
  color-scheme: dark;
}

/* Fallback when scripts are disabled. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #151A35;
    --surface: #1F2548;
    --ink: #E7EAF6;
    --muted: #9AA2C4;
    --accent: #FFC65C;
    --line: #2F3766;
    --sky: #262E5C;
    color-scheme: dark;
  }
}

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

html { scroll-padding-top: env(safe-area-inset-top, 0px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  transition: background-color 400ms ease, color 400ms ease;
}

a { color: inherit; }

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

.wrap {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding-block: clamp(3rem, 10vh, 7rem) clamp(3rem, 8vh, 5rem);
}

.name {
  margin: 0;
  font-family: var(--title);
  font-size: var(--step-3);
  font-variation-settings: "opsz" 144, "ROND" 100;
  line-height: 1;
  letter-spacing: -0.02em;
}

.role {
  margin: 0.6rem 0 0;
  font-family: var(--body);
  font-size: var(--step-2);
  font-weight: 500;
  color: var(--muted);
}

.intro {
  max-width: 34rem;
  margin: 1.75rem 0 2rem;
  font-size: var(--step-1);
  line-height: 1.5;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.links a {
  font-weight: 600;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.links a:hover { color: var(--accent); }

/* Phone */

.device { text-align: center; }

.phone {
  position: relative;
  width: 14.5rem;
  padding: 0.45rem;
  border-radius: 2.6rem;
  background: var(--ink);
  transition: background-color 400ms ease;
}

/* Power and volume buttons on the right edge. */
.phone::before,
.phone::after {
  content: "";
  position: absolute;
  right: -0.2rem;
  width: 0.2rem;
  border-radius: 0 0.2rem 0.2rem 0;
  background: var(--ink);
  transition: background-color 400ms ease;
}

.phone::before { top: 6.5rem; height: 2.6rem; }
.phone::after { top: 10.5rem; height: 4.5rem; }

.screen {
  display: flex;
  flex-direction: column;
  aspect-ratio: 9 / 20;
  overflow: hidden;
  border-radius: 2.2rem;
  background: var(--surface);
  text-align: left;
  transition: background-color 400ms ease;
}

.status {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1.4rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.camera {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  width: 0.8rem;
  height: 0.8rem;
  margin-left: -0.4rem;
  border-radius: 50%;
  background: #05070F;
}

.sky {
  position: relative;
  flex: 1;
  min-height: 9rem;
  background: var(--sky);
  transition: background-color 400ms ease;
}

.orb {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -2.1rem;
  width: 4.2rem;
  height: 4.2rem;
  margin-left: -2.1rem;
  border-radius: 50%;
  background: #FFB938;
  box-shadow: 0 0 0 0.6rem rgba(255, 185, 56, 0.25);
  transition: background-color 500ms ease, box-shadow 500ms ease;
}

/* The inset shadow cuts the sun into a crescent moon. */
:root[data-theme="dark"] .orb {
  background: transparent;
  box-shadow: inset -1.1rem -0.5rem 0 0 var(--accent);
}

.setting {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: 600 0.95rem var(--body);
  text-align: left;
  cursor: pointer;
}

.track {
  position: relative;
  flex: none;
  width: 2.9rem;
  height: 1.7rem;
  border-radius: 1rem;
  background: var(--line);
  transition: background-color 250ms ease;
}

.knob {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--surface);
  transition: transform 250ms ease;
}

.setting[aria-checked="true"] .track { background: var(--accent); }
.setting[aria-checked="true"] .knob { transform: translateX(1.2rem); }

.code {
  margin: 0;
  padding: 1rem 1.2rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre;
  overflow-x: auto;
}

.code b {
  font-weight: 600;
  color: var(--accent);
}

.caption {
  max-width: 15rem;
  margin: 1rem auto 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Sections */

section {
  padding-block: clamp(2.5rem, 6vh, 4rem);
  border-top: 1px solid var(--line);
}

h2 {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.about p {
  max-width: 38rem;
  margin: 0;
}

.apps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.5rem 3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.app img {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 22%;
  box-shadow: 0 0 0 1px var(--line);
}

.app-name {
  display: block;
  font-size: var(--step-1);
  font-weight: 600;
}

.app-desc {
  display: block;
  color: var(--muted);
}

.app:hover .app-name { color: var(--accent); }

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 2rem 3rem;
  margin: 0;
}

.skills dt {
  font-family: var(--body);
  font-size: var(--step-1);
  font-weight: 600;
}

.skills dd {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.contact p {
  max-width: 34rem;
  margin: 0 0 1.5rem;
}

footer {
  padding-block: 2rem 3rem;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .device { justify-self: start; }
  .caption { margin-inline: 0; text-align: left; }
}

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