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

  :root {
    --bg:       #F8F7F4;
    --bg2:      #EEECEA;
    --bg3:      #D8D5D1;
    --text:     #1A1916;
    --text2:    #3A3834;
    --text3:    #6B6860;
    --orange:   #FF5F00;
    --orange-l: #FF7A29;
    --orange-d: #CC4C00;
    --blue:     #0057FF;
    --blue-d:   #0040CC;
    --blue-t:   #E5ECFF;
    --border:   rgba(26,25,22,0.1);
    --font-display: 'Syne', sans-serif;
    --font-body:    'DM Sans', sans-serif;
    --font-mono:    'DM Mono', monospace;
  }

  html.dark {
    --bg:       #1A1916;
    --bg2:      #242220;
    --bg3:      #3A3834;
    --text:     #F0EEE9;
    --text2:    #C8C5C0;
    --text3:    #6B6860;
    --orange:   #FF5F00;
    --orange-l: #FF7A29;
    --orange-d: #CC4C00;
    --blue:     #4D85FF;
    --blue-d:   #3A6FE0;
    --blue-t:   #0F1F3D;
    --border:   rgba(240,238,233,0.08);
  }

  html { scroll-behavior: smooth; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* ── NOISE TEXTURE ── */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
  }

  /* ── AVAILABILITY BAR ── */
  .avail-bar {
    background: var(--orange);
    padding: 7px max(24px, env(safe-area-inset-right, 0px)) 7px max(24px, env(safe-area-inset-left, 0px));
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 10;
  }
  .avail-bar span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #fff;
    letter-spacing: 0.04em;
  }
  .avail-dot {
    width: 6px; height: 6px;
    flex-shrink: 0; /* keep it round when the message wraps on narrow phones */
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
    animation: pulse 2s ease-in-out infinite;
  }
  @keyframes pulse {
    0%,100% { opacity: 1; } 50% { opacity: 0.3; }
  }

  /* ── LAYOUT ── */
  .container { max-width: 960px; margin: 0 auto; padding: 0 var(--pad-r) 0 var(--pad-l); position: relative; z-index: 1; }

  /* ── HERO ── */
  .hero {
    padding: 80px 0 72px;
    position: relative;
  }
  .hero-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 64px;
    align-items: center;
  }
  .hero-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .hero-tag::before {
    content: '';
    display: inline-block;
    width: 24px; height: 1.5px;
    background: var(--orange);
  }
  .hero h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 24px;
  }
  .hero h1 em {
    color: var(--orange);
    font-style: normal;
  }
  .hero-sub {
    font-size: 16px;
    color: var(--text2);
    max-width: 480px;
    line-height: 1.75;
    margin-bottom: 36px;
  }
  .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

  /* ── PIXEL IMAGE ── */
  .hero-image-wrap {
    position: relative;
    width: 300px;
    height: 300px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--orange);
    box-shadow: 0 0 0 4px rgba(255,95,0,0.15), 0 0 40px rgba(255,95,0,0.25), 0 0 80px rgba(255,95,0,0.1);
  }
  .hero-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    image-rendering: pixelated;
  }
  /* static scanline grid */
  .hero-image-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 2px,
      rgba(0,0,0,0.18) 2px,
      rgba(0,0,0,0.18) 4px
    );
    pointer-events: none;
    z-index: 2;
    border-radius: 50%;
  }
  /* moving scanline sweep - stronger */
  .scanline {
    position: absolute;
    top: -60%;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(
      to bottom,
      transparent 0%,
      rgba(255, 95, 0, 0.08) 20%,
      rgba(255, 95, 0, 0.28) 45%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 95, 0, 0.28) 55%,
      rgba(255, 95, 0, 0.08) 80%,
      transparent 100%
    );
    animation: scanline-sweep 2.2s linear infinite;
    pointer-events: none;
    z-index: 3;
  }
  @keyframes scanline-sweep {
    0%   { top: -60%; }
    100% { top: 100%; }
  }

  /* mobile image slot - hidden on desktop */
  .hero-image-mobile-wrap { display: none; }
  .hero-image-mobile-wrap .hero-image-wrap {
    width: 220px; height: 220px;
    margin: 24px auto;
  }

  @media (max-width: 860px) {
    .hero-inner {
      display: flex;
      flex-direction: column;
      gap: 0;
    }
    .hero-image-desktop-wrap { display: none; }
    .hero-image-mobile-wrap { display: block; }
    .hero-image-mobile-wrap .hero-image-wrap { width: 180px; height: 180px; margin: 20px auto; }
    .hero { padding: 48px 0 40px; }
    .hero-text { width: 100%; }
    .hero-sub { max-width: 100%; }
    section { padding: 40px 0; }
    .section-header { margin-bottom: 20px; }
  }

  /* Short, wide screens (iPhone Duo open, tablets on their side): the
     two-column hero stays, but shrinks so the portrait and the buttons
     fit above the fold instead of the 300px portrait filling the screen */
  @media (min-width: 861px) and (max-height: 700px) {
    .hero { padding: 32px 0 40px; }
    .hero-inner { gap: 44px; }
    .hero-tag { margin-bottom: 14px; }
    .hero-sub { line-height: 1.6; }
    .hero-image-desktop-wrap .hero-image-wrap { width: 230px; height: 230px; }
    .hero h1 { margin-bottom: 18px; }
    .hero-sub { margin-bottom: 26px; }
  }
  /* Phones on their side, stacked hero: keep the portrait small */
  @media (max-width: 860px) and (max-height: 500px) {
    .hero { padding: 32px 0 32px; }
    .hero-image-mobile-wrap .hero-image-wrap { width: 140px; height: 140px; margin: 16px auto; }
  }
  /* iPhone Duo folded is about 382px wide in Safari: tighten the hero buttons
     so both stay on one line */
  @media (max-width: 400px) {
    .hero-actions .btn-primary, .hero-actions .btn-secondary { padding: 12px 18px; }
  }

  @media (max-width: 600px) {
    .hero-text { text-align: center; }
    .hero-tag { justify-content: center; }
    .hero-tag::before { display: none; }
    .hero-actions { justify-content: center; }
  }
  .btn-primary {
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background 0.2s, transform 0.15s;
  }
  .btn-primary:hover { background: var(--orange-d); }
  @media (hover: hover) { .btn-primary:hover { transform: translateY(-1px); } }
  .btn-secondary {
    background: none;
    color: var(--text);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 13px;
    font-family: var(--font-body);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
  }
  .btn-secondary:hover { background: var(--bg2); }
  @media (hover: hover) { .btn-secondary:hover { transform: translateY(-1px); } }

  /* ── SECTIONS ── */
  section {
    padding: 64px 0;
    position: relative;
  }
  /* Section dividers - centered and limited to the content column width */
  section::after,
  .hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 auto;
    width: calc(100% - 80px);
    max-width: 880px;
    height: 0.5px;
    background: var(--border);
  }
  .section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 32px;
  }
  .section-title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
  }
  .section-link {
    font-size: 12px;
    color: var(--blue);
    text-decoration: none;
    font-family: var(--font-mono);
    transition: color 0.2s;
  }
  .section-link:hover { color: var(--blue-d); }

  /* ── PROJECTS ── */
  .project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  @media (min-width: 640px) {
    .project-grid { grid-template-columns: repeat(2, 1fr); }
  }
  .project-card {
    background: var(--bg2);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    flex: 0 0 300px;
    min-width: 0;
  }
  @media (hover: hover) {
    .project-card:hover {
      border-color: var(--orange);
      transform: translateY(-2px);
      box-shadow: 0 8px 32px rgba(255,95,0,0.08);
    }
  }
  .project-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
  }
  .project-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
  }
  .project-desc {
    font-size: 13px;
    color: var(--text3);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 16px;
  }
  .project-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .project-stack { display: flex; gap: 4px; flex-wrap: wrap; }
  .stack-pill {
    font-family: var(--font-mono);
    font-size: 10px;
    background: var(--bg3);
    color: var(--text2);
    padding: 2px 7px;
    border-radius: 4px;
  }
  .project-arrow { color: var(--blue); font-size: 16px; }

  /* ── ABOUT ── */
  .about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: start;
  }
  .about-text {
    font-size: 15px;
    color: var(--text2);
    line-height: 1.8;
  }
  .about-text p + p { margin-top: 16px; }
  .about-text a {
    color: var(--blue);
    text-decoration: none;
  }
  .about-text a:hover { text-decoration: underline; }
  .skills-block { display: flex; flex-direction: column; gap: 20px; }
  .skill-group-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text3);
    margin-bottom: 8px;
  }
  .skill-tags { display: flex; flex-wrap: wrap; gap: 5px; }
  .skill-tag {
    font-size: 12px;
    background: var(--bg2);
    border: 0.5px solid var(--border);
    color: var(--text2);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: var(--font-mono);
  }
  .skill-tag.highlight {
    background: var(--blue-t);
    border-color: var(--blue);
    color: var(--blue);
  }

  /* ── CERTIFICATIONS ── */
  .cert-card {
    background: var(--bg2);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.2s, transform 0.15s;
    min-width: 0;
  }
  @media (hover: hover) { .cert-card:hover { border-color: var(--orange); transform: translateY(-2px); } }
  .cert-card:active { transform: scale(0.97) !important; }
  .cert-groups { display: flex; flex-direction: column; gap: 28px; }
  .cert-group-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text3);
    margin-bottom: 10px;
  }
  .cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
  }
  .cert-badge {
    width: 52px; height: 52px;
    flex-shrink: 0;
    object-fit: contain;
    transition: filter 0.25s ease, opacity 0.25s ease;
  }
  /* Grayscale at rest, full official color on hover/focus - gated to hover-capable devices so touch always shows full color */
  @media (hover: hover) {
    .cert-badge { filter: grayscale(1); opacity: 0.9; }
    .cert-card:hover .cert-badge,
    .cert-card:focus-visible .cert-badge { filter: grayscale(0); opacity: 1; }
  }
  .cert-issuer {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
  }
  .cert-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
  }
  .cert-arrow { margin-left: auto; color: var(--blue); font-size: 14px; flex-shrink: 0; }

  /* ── EXPERIENCE ── */
  .experience-list { display: flex; flex-direction: column; gap: 0; }
  .exp-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 0.5px solid var(--border);
  }
  .exp-item:last-child { border-bottom: none; }
  .exp-date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text3);
    padding-top: 3px;
    line-height: 1.5;
  }
  .exp-role {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
    letter-spacing: -0.01em;
  }
  .exp-company {
    font-size: 13px;
    color: var(--orange);
    font-family: var(--font-mono);
    margin-bottom: 10px;
  }
  .exp-bullets { list-style: none; display: flex; flex-direction: column; gap: 6px; }
  .exp-bullets li {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.6;
    padding-left: 14px;
    position: relative;
  }
  .exp-bullets li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--orange);
    font-size: 11px;
  }

  /* ── EDUCATION ── */
  .education-list { display: flex; flex-direction: column; gap: 0; }
  .edu-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 24px;
    padding: 20px 0;
    border-bottom: 0.5px solid var(--border);
  }
  .edu-item:last-child { border-bottom: none; }
  .edu-date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text3);
    padding-top: 3px;
  }
  .edu-degree {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
    letter-spacing: -0.01em;
  }
  .edu-school {
    font-size: 13px;
    color: var(--text3);
    font-family: var(--font-mono);
  }

  /* ── CONTACT ── */
  .contact-form-wrap { max-width: 600px; }

  /* ── CONTACT FORM ── */
  .contact-form { display: flex; flex-direction: column; gap: 12px; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .field { display: flex; flex-direction: column; gap: 6px; }
  .field label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text3);
  }
  .field input, .field textarea {
    background: var(--bg2);
    border: 0.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    resize: none;
  }
  .field input::placeholder, .field textarea::placeholder { color: var(--text3); }
  .field input:focus, .field textarea:focus { border-color: var(--orange); }
  .field textarea { min-height: 120px; }
  .form-submit {
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    align-self: flex-start;
    transition: background 0.2s, transform 0.15s;
  }
  .form-submit:hover { background: var(--orange-d); }
  @media (hover: hover) { .form-submit:hover { transform: translateY(-1px); } }

  /* ── TACTILE FEEDBACK ── */
  .btn-primary:active { transform: translateY(1px) scale(0.97) !important; box-shadow: none !important; }
  .btn-secondary:active { transform: translateY(1px) scale(0.97) !important; box-shadow: none !important; }
  .project-card:active { transform: translateY(0px) scale(0.98) !important; box-shadow: none !important; }
  .fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .fade-in.visible { opacity: 1; transform: none; }

  /* Respect users who prefer reduced motion - show everything, skip animations */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
    .fade-in { opacity: 1 !important; transform: none !important; }
  }

  @media (max-width: 720px) {
    section::after, .hero::after { width: calc(100% - 40px); }
    .hero { padding: 48px 0 40px; }
    .about-grid { grid-template-columns: 1fr; gap: 32px; }
    .form-row { grid-template-columns: 1fr; }
    .exp-item, .edu-item { grid-template-columns: 1fr; gap: 6px; }
    .exp-date, .edu-date { font-size: 10px; }
  }

  /* moved from inline style attributes */
  .credential-link { color: var(--blue); text-decoration: none; }
  .contact-intro { font-size: 15px; color: var(--text2); margin-bottom: 32px; max-width: 480px; line-height: 1.75; }
