/* =====================================================================
 * style.css  |  Chris Brian Antipala portfolio
 * Sections of this file, in order:
 *   1. Colors and settings (CSS variables)   5. Content sections
 *   2. Base styles and background            6. Animations
 *   3. ID card (left side)                   7. Responsive rules
 *   4. Navigation
 * Tip: use Ctrl+F and search for the section names written in comments.
 * ===================================================================== */

/* 1. COLORS AND SETTINGS (dark theme is the default)
 *  --bg    page background      --card  card/panel background
 *  --ink   main text color      --muted softer text color
 *  --line  borders             --g     ACCENT COLOR (blue). Change it to recolor the site
 *  --gi    text on top of the accent color
 *  --dot   color of the dotted background pattern
 *  --sw    width of the ID card on desktop */
:root {
  --bg: #222; --card: #1b1b1b; --ink: #fff; --muted: #a3a3a3; --line: #454545;
  --g: #4da3ff; --gi: #06101f; --dot: rgba(255,255,255,.07);
  --sw: 350px; --ease: cubic-bezier(.22,.8,.24,1);
  color-scheme: dark; box-sizing: border-box;
}
/* Light theme used automatically when the visitor's device is set to light mode.
 * Keep these values in sync with the manual light theme below. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f4f2; --card: #fff; --ink: #1a1a1a; --muted: #5f5f5f; --line: #d6d6d2;
    --g: #1f6feb; --gi: #fff; --dot: rgba(0,0,0,.07);
    color-scheme: light;
  }
}
/* Light theme chosen with the toggle button (the JS sets data-theme="light") */
:root[data-theme="light"] {
  --bg: #f4f4f2; --card: #fff; --ink: #1a1a1a; --muted: #5f5f5f; --line: #d6d6d2;
  --g: #1f6feb; --gi: #fff; --dot: rgba(0,0,0,.07);
  color-scheme: light;
}

/* 2. BASE STYLES: reset, page font, dotted background */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 300 17px/1.7 Inter, system-ui, sans-serif;
  transition: background-color .4s ease, color .4s ease;
}
/* Dotted background. Make dots bigger/smaller by editing "28px 28px" and "1px". */
body::before {
  content: ""; position: fixed; inset: -6%; z-index: -1; pointer-events: none;
  background: radial-gradient(var(--dot) 1px, transparent 1.2px) 0 0 / 28px 28px;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--g); outline-offset: 3px; }
h1, h2, h3 { font-weight: 300; margin: 0; line-height: 1.12; }
p { margin: 0 0 18px; color: var(--muted); max-width: 34em; }

/* Smooth color/hover changes. Add a selector here to animate more elements. */
.side, .nav, .pc, input, textarea, .tag, .row, .sk, .soc a, .soc button, .nav a, .btn, .hire {
  transition: background-color .4s ease, color .3s ease, border-color .3s ease,
              transform .35s var(--ease), box-shadow .35s ease;
}

/* 3. PROFILE CARD (base layout; the ID-card look is further below) */
.side {
  position: fixed; left: 20px; width: var(--sw);
  top: calc(20px + env(safe-area-inset-top, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  padding: 28px 30px; border: 1px solid var(--line); border-radius: 36px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; align-items: center; text-align: center; overflow: auto;
}
.photo {
  width: 250px; max-width: 100%; height: 210px; margin: 26px 0 22px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 30px;
  background: linear-gradient(135deg, #3a3a3a, #171717);
  font-size: 72px; color: var(--g);
}
.side p { margin: 0; font-size: 19px; line-height: 1.5; color: var(--ink); max-width: none; }
.side p.copy { margin: 18px 0; font-size: 13px; color: var(--muted); }
/* ID CARD design: lanyard slot, blue header band, photo, details grid, barcode. Edit the card text in index.html. */
.side { padding: 0; border-radius: 26px; background: var(--card); backdrop-filter: none; box-shadow: 0 24px 50px -30px #000; transform-origin: 50% 0; animation: sway 2.4s var(--ease) .2s both; }
.slot { width: 64px; height: 12px; margin: 14px 0 12px; flex-shrink: 0; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.band { align-self: stretch; display: flex; justify-content: space-between; align-items: center; padding: 9px 22px; background: var(--g); color: var(--gi); font-size: 12px; font-weight: 500; letter-spacing: .2em; }
.band i { width: 26px; height: 18px; border: 1.5px solid currentColor; border-radius: 4px; opacity: .7; }
/* PHOTO: to use a real picture, put <img src="assets/photo.jpg" alt="Chris Brian"> inside
 * <div class="photo"> in index.html (see README), and add:  .photo img { width:100%; height:100%; object-fit:cover; border-radius:inherit; } */
/*.photo { width: 140px; height: 140px; margin: 18px 0 14px; border-radius: 20px; border: 3px solid var(--g); font-size: 54px; }*/
.photo { overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.idname { font-size: 26px; font-weight: 500; line-height: 1.1; letter-spacing: -.01em; }
.role { margin: 4px 0 14px; font-size: 14px; color: var(--g); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; width: calc(100% - 44px); margin: 0; text-align: left; }
.fields dt { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.fields dd { margin: 0; font-size: 14px; line-height: 1.3; }
.barcode { flex-shrink: 0; width: calc(100% - 44px); height: 28px; margin: 14px 0 0; opacity: .8; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 9px, var(--ink) 9px 12px, transparent 12px 14px); }
.side p.copy { margin: 6px 22px 12px; font-size: 11px; }
.side .soc { margin: 0 22px 14px; }
.side .hire { width: calc(100% - 44px); margin: auto 22px 22px; }
@keyframes sway { 0% { transform: rotate(-4deg); } 30% { transform: rotate(3deg); } 60% { transform: rotate(-1.5deg); } 100% { transform: none; } }
@media (max-height: 740px) { .photo { width: 104px; height: 104px; margin: 12px 0 10px; font-size: 40px; } .role { margin-bottom: 10px; } }
.soc { display: flex; gap: 10px; margin-bottom: 20px; }
.soc a, .soc button, .nav a {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%; color: var(--muted); text-decoration: none;
}
.soc button { background: none; padding: 0; cursor: pointer; }
.soc a:hover, .soc button:hover, .nav a:hover, .nav a.on { color: var(--g); border-color: var(--g); transform: translateY(-2px); }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.btn, .hire {
  display: inline-block; padding: 14px 30px; border: 0; border-radius: 999px;
  background: var(--g); color: var(--gi); text-decoration: none; cursor: pointer;
  font: 400 16px Inter, sans-serif;
}
.btn:hover, .hire:hover { transform: translateY(-3px); box-shadow: 0 10px 26px -8px var(--g); }
.hire { margin-top: auto; width: 100%; flex-shrink: 0; }

/* 4. NAVIGATION: floating icon bar (desktop). Bar/hamburger versions are in the responsive rules. */
.nav {
  position: fixed; right: 28px; z-index: 4; top: calc(160px + env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  border: 1px solid var(--line); border-radius: 40px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px);
}
.nav a { width: 42px; height: 42px; border: 0; }
/* Hamburger button: hidden on large screens, shown on phones (see max-width: 600px below) */
.burger { display: none; }
.burger i, .burger i::before, .burger i::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .35s var(--ease), background-color .2s ease; }
.burger i { position: relative; }
.burger i::before, .burger i::after { content: ""; position: absolute; left: 0; }
.burger i::before { top: -6px; }
.burger i::after { top: 6px; }
.burger.open i { background: transparent; }
.burger.open i::before { transform: translateY(6px) rotate(45deg); }
.burger.open i::after { transform: translateY(-6px) rotate(-45deg); }

/* 5. CONTENT SECTIONS: page layout, headings, tags, stats */
main { margin-left: calc(var(--sw) + 60px); padding: 0 120px 0 56px; }
section { min-height: 100svh; padding: 110px 0 70px; display: flex; flex-direction: column; justify-content: center; }
.tag { align-self: flex-start; display: flex; align-items: center; gap: 8px; margin-bottom: 40px; padding: 6px 18px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.tag svg { width: 14px; height: 14px; }
h1 { max-width: 11em; font-size: clamp(40px, 6vw, 82px); letter-spacing: -.025em; }
h2 { max-width: 14em; margin-bottom: 36px; font-size: clamp(30px, 4vw, 54px); letter-spacing: -.02em; }
h1 em, h2 em { font-style: normal; color: var(--g); transition: color .4s ease; }
.lead { max-width: 30em; margin: 36px 0 0; }
.stats { display: flex; gap: 56px; margin-top: 48px; }
.stats b { display: block; font-size: 44px; font-weight: 300; line-height: 1; color: var(--g); }
.stats span { font-size: 14px; color: var(--muted); }

/* "My projects" spinning circle in the home section. The text path is defined in index.html. */
.ring { position: absolute; right: 0; bottom: 48px; width: 150px; height: 150px; }
.ring > svg { width: 100%; height: 100%; animation: spin 18s linear infinite; will-change: transform; }
.ring text { fill: var(--ink); font: 12.5px Inter, sans-serif; letter-spacing: .1em; }
.ring i { position: absolute; inset: 0; display: grid; place-items: center; transition: transform .35s var(--ease); }
.ring:hover i { transform: translateY(6px); }
.ring i svg { width: 34px; height: 34px; fill: none; stroke: var(--ink); stroke-width: 1.5; }

/* Resume rows (.row) and skills rows (.sk) */
.row { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 22px 0; border-top: 1px solid var(--line); }
.row:hover, .sk:hover { border-top-color: var(--g); }
.row time { padding-top: 4px; font-size: 14px; color: var(--muted); }
.row h3 { margin-bottom: 4px; font-size: 24px; }
.row p { margin: 0; }
.cert h3 { font-size: 20px; line-height: 1.35; }
.sk { display: grid; grid-template-columns: 170px 1fr; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); }
.sk b { font-weight: 400; }
.sk span { color: var(--muted); }

/* Project cards (.pc) */
.proj { display: grid; gap: 18px; }
.pc { padding: 34px; border: 1px solid var(--line); border-radius: 28px; background: var(--card); }
.pc:hover { transform: translateY(-5px); border-color: var(--g); box-shadow: 0 18px 40px -22px var(--g); }
.pc h3 { margin-bottom: 12px; font-size: 30px; }
.t { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.t span { padding: 3px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); }
.pc .btn { margin-top: 22px; }

/* Contact section: email link and form */
.mail { font-size: clamp(20px, 3vw, 34px); color: var(--g); text-decoration: none; word-break: break-word; }
form { display: grid; gap: 14px; max-width: 520px; margin-top: 28px; }
input, textarea { width: 100%; padding: 14px 20px; border: 1px solid var(--line); border-radius: 20px; background: transparent; color: var(--ink); font: 300 17px Inter, sans-serif; }
input:focus, textarea:focus { border-color: var(--g); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--g) 25%, transparent); }
textarea { min-height: 130px; resize: vertical; }
footer { padding: 40px 0 0; font-size: 13px; color: var(--muted); }

/* Resume / CV download buttons in the Resume section */
.dl { display: flex; flex-wrap: wrap; gap: 12px; margin: -8px 0 30px; }
.btn svg { margin-right: 8px; vertical-align: -4px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--g); color: var(--g); box-shadow: none; }

/* 6. ANIMATIONS (.rv = reveal on scroll, spin = rotating ring) */
/* Scroll reveal: every direct child of a section starts hidden and slides in when it enters
 * the screen (added by main.js). --from is the starting position, --d is a small stagger delay. */
.rv { opacity: 0; transform: var(--from, translateY(26px)); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }
/* Each section enters differently. Change the translate/scale values to change the effect. */
#home { --from: translateY(34px); }
#about { --from: translateX(-52px); }
#resume { --from: translateX(52px); }
#certifications { --from: translateY(26px) scale(.92); }
#skills { --from: translateX(-52px); }
#projects { --from: translateY(48px) scale(.94); }
#contact { --from: translateY(30px) scale(.97); }
h2 em { background: linear-gradient(var(--g), var(--g)) 0 100% / 0 2px no-repeat; transition: background-size .9s var(--ease) .5s, color .4s ease; }
h2.in em { background-size: 100% 2px; }
@keyframes spin { to { transform: rotate(360deg); } }


/* 7. RESPONSIVE RULES
 *  wider than 1200px : ID card on the left, icon nav on the right
 *  up to 1200px         : slightly narrower card
 *  up to 1000px         : card moves to the top, nav becomes a bar at the bottom
 *  up to 600px          : nav becomes a hamburger menu */
@media (max-width: 1200px) {
  :root { --sw: 310px; }
  main { padding: 0 100px 0 40px; }

}
@media (max-width: 1000px) {
  .side { position: static; width: auto; max-width: 380px; margin: 16px auto; }

  .hire { margin-top: 22px; max-width: 320px; }
  .nav {
    top: auto; right: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    flex-direction: row; gap: 0; padding: 4px; transform: translateX(50%);
  }
  .nav a { width: 40px; height: 40px; }
  main { margin: 0; padding: 0 28px 90px; }
  section { min-height: 0; padding: 70px 0; }
  .ring { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .burger {
    position: fixed; z-index: 7; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px;
    width: 48px; height: 48px; display: grid; place-items: center; padding: 0; cursor: pointer;
    border: 1px solid var(--line); border-radius: 50%; color: var(--ink);
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px);
  }
  .nav {
    top: calc(70px + env(safe-area-inset-top, 0px)); right: 14px; bottom: auto;
    flex-direction: column; gap: 2px; padding: 8px; border-radius: 26px; transform-origin: top right;
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.96);
    transition: opacity .25s ease, transform .3s var(--ease), visibility .25s;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a { width: auto; height: 46px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 20px 0 14px; border-radius: 999px; white-space: nowrap; }
  .nav a::after { content: attr(aria-label); font-size: 15px; color: var(--ink); }
  .nav a.on::after { color: var(--g); }
  .nav a:hover { transform: none; background: color-mix(in srgb, var(--g) 14%, transparent); }
  main { padding: 0 20px 90px; }
  .row, .sk { grid-template-columns: 1fr; gap: 4px; }
  .stats { flex-wrap: wrap; gap: 28px; }
  .pc { padding: 24px; }
  .side p { font-size: 17px; }
}
/* Respect visitors who ask their device to reduce motion: turn animations off */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; transition-delay: 0s !important; }
  .rv { opacity: 1; transform: none; }
}
