/* Color tokens (dark defaults) */
:root{
  --bg:#0f0f10;
  --card:#141417;
  --text:#e8e8ea;
  --muted:#a1a1aa;
  --muted-mid:#b3b3b8;
  --muted-light:#c7c7cc;
  --link:#ffffff;
  --border:#232327;
  --accent:#e67e22;
}

:root{ color-scheme: light dark; }

/* Light theme overrides */
.theme-light{
  --bg:#f7f7f8;
  --card:#ffffff;
  --text:#17171a;
  --muted:#5b5b63;
  --muted-mid: #6f6f77;
  --link:#0b0b0e;
  --border:#e7e7ec;
  --accent:#d35400;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font:16px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,"Helvetica Neue",Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

.link-item:focus-visible,
.socials a:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ensure images never overflow */
img{ max-width:100%; height:auto; }

/* Container */
.container{
  max-width:720px;
  margin:0 auto;
  padding:56px 20px;
  position:relative;
}

/* Theme toggle button */
.theme-toggle{
  position:absolute;
  top:16px; right:16px;
  width:40px; height:40px;
  display:grid; place-items:center;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--card);
  cursor:pointer;
  transition:transform .12s ease, border-color .12s ease, background .12s ease;
}
.theme-toggle:hover{ transform:translateY(-1px); border-color:var(--accent); }
.theme-toggle svg{ width:18px; height:18px; fill:var(--text); }

/* Show only the relevant icon based on theme */
.theme-dark .icon-sun{ display:none; }
.theme-dark .icon-moon{ display:block; }
.theme-light .icon-sun{ display:block; }
.theme-light .icon-moon{ display:none; }

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce){
  .theme-toggle{ transition:none }
  .link-item{ transition:none }
}

/* Header */
.header{ text-align:center; margin-bottom:40px; }
.avatar{
  width:140px; height:140px; border-radius:50%;
  object-fit:cover; display:block; margin:0 auto 16px;
  border:2px solid var(--border);
  box-shadow:0 6px 24px rgba(0,0,0,.25);
}
.name{ font-size:28px; line-height:1.2; margin:8px 0 6px; }
.tagline{ color:var(--muted); margin:0 auto 16px; max-width:52ch; }

/* Socials */
.socials{
  display:flex; gap:14px; justify-content:center; margin-top:8px;
}
.socials a{
  display:grid; place-items:center;
  width:38px; height:38px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--card);
  text-decoration:none;
  transition:transform .12s ease, border-color .12s ease;
}
.socials a:hover{ transform:translateY(-1px); border-color:var(--accent); }
.socials svg{ width:18px; height:18px; fill:var(--text); opacity:.9; }

/* Section */
.section{
  margin-top:28px; padding:18px;
  border:1px solid var(--border);
  border-radius:14px; background:var(--card);
}
.section-title{
  font-size:14px; text-transform:uppercase; letter-spacing:.08em;
  color:var(--muted); margin:0 0 8px 4px;
}

/* Featured section styling */
.section--featured{
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 40%, transparent) inset;
  background:
    linear-gradient(
      to bottom,
      color-mix(in oklab, var(--accent) 6%, transparent),
      transparent 60%
    ),
    var(--card);
}

/* Slightly boost its title */
.section--featured .section-title{
  color: var(--accent);
}

/* Links list */
.link-list{ list-style:none; padding:0; margin:0; display:grid; gap:6px; }
.link-item {
  display:grid;
  grid-template-columns: 1fr auto;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid transparent;
  border-radius:10px;
  text-decoration:none;
  color:var(--link);
  transition:background .12s ease, border-color .12s ease, transform .12s ease;
  width: 100%;
}
/* When it’s not a link (<div>), disable hover effects and cursor */
.link-item:not(a) {
  cursor:default;
  pointer-events:none;
  border-color:transparent;
  transform:none !important;
}
@media (hover:hover) and (pointer:fine){
  .link-item:hover{
    background: color-mix(in oklab, var(--link) 2%, transparent);
    border-color: var(--border);
    transform: translateY(-1px);
  }
  .socials a:hover{ transform: translateY(-1px); border-color: var(--accent); }
}

.link-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;    /* needed inside grid so ellipsis actually works */
  max-width: 100%; /* prevents overflow */
}
.link-name {
  color: var(--text);
  font-weight: 500;
}
.link-desc {
  color: var(--muted-mid);
  font-weight: 400;
}

.arrow{ opacity:.6; }

/* Footer */
.footer{ text-align:center; color:var(--muted); margin-top:28px; font-size:14px; }

/* Responsive */
@media (max-width:480px){
  .container{ padding:40px 16px }
  .avatar{ width:120px; height:120px }
  .name{ font-size:24px }
}

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

/* Optional: honor system light preference on first visit (when no saved theme) */
@media (prefers-color-scheme: light){
  :root:not(.theme-dark):not(.theme-light){
    /* Only apply if no explicit theme class yet */
    --bg:#f7f7f8;
    --card:#ffffff;
    --text:#17171a;
    --muted:#5b5b63;
    --link:#0b0b0e;
    --border:#e7e7ec;
    --accent:#1a5fd6;
  }
}


/* Mobile readability + layout fixes */
@media (max-width: 520px){
  .link-item {
    width: 100%;
    padding: 9px 10px;
    gap: 8px;
  }

  /* CHANGE starts here */
  .link-text {
    display: block;            /* was inline-flex → breaks ellipsis on iOS */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;              /* allow shrink inside grid */
    max-width: 100%;
  }

  .link-name,
  .link-desc {
    display: inline;
    font-size: 16px;
  }

  .link-desc {
    margin-left: 4px;
    color: var(--muted-mid);
  }
}


/* Super-small screens: hide desc if space is *really* tight */
@media (max-width: 360px){
  .link-desc {
    display: none;
  }
}

@supports not (background: color-mix(in oklab, white 2%, transparent)){
  .theme-dark .link-item:hover { background: rgba(255,255,255,.03); }
  .theme-light .link-item:hover { background: rgba(0,0,0,.03); }
}




