/* ============================================================
   Claudio Rotolo — @cdscih · personal portfolio
   Terminal-adjacent, light + dark via CSS light-dark().
   ============================================================ */

:root {
  color-scheme: light dark;

  /* surfaces */
  --bg:            light-dark(#f7f6f2, #101113);
  --header-bg:     light-dark(rgba(247, 246, 242, .9), rgba(16, 17, 19, .9));
  --border:        light-dark(#e5e2da, #26282b);
  --card-bg:       light-dark(#ffffff, transparent);
  --field-bg:      light-dark(#ffffff, #16181b);

  /* text */
  --fg:            light-dark(#55534c, #c9c7c1);
  --strong:        light-dark(#22211e, #ecebe5);
  --body:          light-dark(#6e6b64, #86847e);
  --body-alt:      light-dark(#6e6b64, #6d6b66);
  --muted:         light-dark(#98948b, #5d5b56);
  --faint:         light-dark(#b1ada3, #45443f);

  /* interactive */
  --logo:          light-dark(#8c887f, #86847e);
  --nav:           light-dark(#8c887f, #6d6b66);
  --nav-active:    light-dark(#22211e, #e8e6df);
  --accent:        light-dark(#37804d, #8fd0a0);

  /* fields + tags + icon button */
  --field-border:  light-dark(#d9d6cd, #2c2e32);
  --tag-border:    light-dark(#ddd9d0, #2c2e32);
  --tag-fg:        light-dark(#8c887f, #6d6b66);
  --icon-border:   light-dark(#d9d6cd, #2c2e32);
  --icon-border-h: light-dark(#b1ada3, #45443f);

  /* hatch placeholder */
  --hatch-a:       light-dark(#efede7, #16181b);
  --hatch-b:       light-dark(#ebe9e2, #191b1f);

  --maxw: 1020px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
}

::placeholder { color: light-dark(#a5a199, #5d5b56); }

@keyframes blink { 50% { opacity: 0; } }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 20px;
}

.logo {
  font-size: 14px;
  color: var(--logo);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 26px;
  align-items: center;
  font-size: 13px;
}

.nav a {
  color: var(--nav);
  text-decoration: none;
  transition: color .15s ease;
}

.nav a:hover { color: var(--strong); }

.nav a.nav-active { color: var(--nav-active); }

/* theme toggle */
.theme-toggle {
  border: 1px solid var(--icon-border);
  background: transparent;
  color: var(--nav);
  font-family: inherit;
  padding: 6px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color .15s ease, border-color .15s ease;
}

.theme-toggle:hover {
  color: var(--strong);
  border-color: var(--icon-border-h);
}

.theme-toggle .icon { display: none; }
.theme-toggle .icon svg { display: block; }
:root[data-theme="system"] .theme-toggle .icon-system,
:root[data-theme="light"]  .theme-toggle .icon-light,
:root[data-theme="dark"]   .theme-toggle .icon-dark { display: grid; place-items: center; }

/* ---------- hero ---------- */
.hero { padding-top: 110px; padding-bottom: 100px; }

.prompt {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--muted);
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--accent);
  margin-left: 10px;
  vertical-align: text-bottom;
  animation: blink 1.2s steps(1) infinite;
}

.hero-title {
  margin: 0;
  font-size: clamp(30px, 4.5vw, 46px);
  line-height: 1.3;
  font-weight: 400;
  color: var(--strong);
  max-width: 800px;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.accent { color: var(--accent); }

.hero-sub {
  margin: 30px 0 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--body);
  max-width: 620px;
  font-family: system-ui, sans-serif;
}

/* ---------- generic section ---------- */
.section { padding-bottom: 90px; scroll-margin-top: 90px; }

.section-label {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--muted);
}

.note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--faint);
}

.muted { color: var(--muted); }

.hatch {
  background: repeating-linear-gradient(
    -45deg,
    var(--hatch-a), var(--hatch-a) 10px,
    var(--hatch-b) 10px, var(--hatch-b) 20px
  );
}

.shot-label {
  font-size: 11.5px;
  color: var(--muted);
}

/* real screenshots filling a card's image panel */
.shot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- projects ---------- */
.project-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card-bg);
  display: grid;
  grid-template-columns: minmax(280px, 400px) 1fr;
}

.project-shot {
  display: grid;
  place-items: center;
  min-height: 250px;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

/* favour the phone (right side of the hero) in the narrow project panel */
.project-shot .shot-img { object-position: 64% center; }

.project-body { padding: 34px 38px; }

.project-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.project-name { font-size: 22px; color: var(--strong); }

.badge-live { font-size: 12px; color: var(--accent); }

.project-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease;
}
.project-link:hover { color: var(--strong); }

.project-desc {
  margin: 14px 0 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--body);
  font-family: system-ui, sans-serif;
  max-width: 480px;
}

.tags {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11.5px;
  color: var(--tag-fg);
  border: 1px solid var(--tag-border);
  border-radius: 5px;
  padding: 4px 9px;
}

/* ---------- websites ---------- */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.site-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card-bg);
}

.site-shot {
  height: 150px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.site-caption {
  padding: 14px 16px;
  font-size: 12.5px;
  color: var(--body);
  border-top: 1px solid var(--border);
}

/* clickable website card (links out, like the Nouly link) */
a.site-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease;
}
a.site-card:hover { border-color: var(--icon-border-h); }
a.site-card:hover .site-url { color: var(--accent); }

.site-url {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
  transition: color .15s ease;
}

/* "more to come" placeholder card — stretches to match its neighbour */
.site-card-soon {
  display: grid;
  place-items: center;
  min-height: 194px;
  border-style: dashed;
  background: transparent;
}

.soon-label {
  font-size: 13px;
  font-style: italic;
  color: var(--faint);
}

/* ---------- work ---------- */
/* three aligned columns — date · company · role — as one shared grid */
.worklog {
  display: grid;
  grid-template-columns: max-content max-content 1fr;
  align-items: baseline;
  gap: 16px 48px;
  font-size: 14px;
}

/* each row's three cells drop into the parent grid so columns line up */
.work-row { display: contents; }

.work-date { color: var(--muted); }

.work-co {
  color: var(--strong);
  text-decoration: none;
  transition: color .15s ease;
}
a.work-co:hover { color: var(--accent); }

.work-role {
  color: var(--body-alt);
  font-family: system-ui, sans-serif;
  font-size: 13.5px;
}

/* ---------- contact ---------- */
.contact { padding-bottom: 100px; }

.contact-inner { max-width: 620px; }

.contact-heading {
  margin: 0 0 24px;
  font-size: 20px;
  color: var(--strong);
  font-family: system-ui, sans-serif;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-form input,
.contact-form textarea {
  padding: 13px 16px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--field-bg);
  font-size: 13.5px;
  color: var(--strong);
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease;
}

.contact-form textarea { resize: vertical; }

.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--accent); }

.send-btn {
  align-self: flex-start;
  padding: 12px 24px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.send-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.contact-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); }

.footer-inner {
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.social {
  display: flex;
  gap: 22px;
}

.social a {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease;
}
.social a:hover { color: var(--strong); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .wrap { padding-left: 22px; padding-right: 22px; }
  .hero { padding-top: 84px; padding-bottom: 72px; }
  .nav { gap: 18px; }
  .project-card { grid-template-columns: 1fr; }
  .project-shot { border-right: none; border-bottom: 1px solid var(--border); min-height: 200px; }
  .project-body { padding: 26px 24px; }
  .worklog { column-gap: 28px; }
}

@media (max-width: 480px) {
  .nav { gap: 14px; font-size: 12px; }
  .logo { font-size: 13px; }
  .worklog { column-gap: 18px; row-gap: 14px; }
}

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